|
|
@ -1,5 +1,6 @@
|
|
|
|
//! Message values
|
|
|
|
//! Message values
|
|
|
|
use super::*;
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
|
|
|
|
|
|
|
/// A value that can be used for messages.
|
|
|
|
/// A value that can be used for messages.
|
|
|
|
pub trait MessageValue: Serialize + for<'de> Deserialize<'de>{}
|
|
|
|
pub trait MessageValue: Serialize + for<'de> Deserialize<'de>{}
|
|
|
@ -24,3 +25,9 @@ pub struct MessageValueAny(Box<dyn Any +'static>);
|
|
|
|
//impl<T> MessageValue for DynamicMessageValue<T>
|
|
|
|
//impl<T> MessageValue for DynamicMessageValue<T>
|
|
|
|
//where T: Serialize + for<'de> Deserialize<'de> + Any{}
|
|
|
|
//where T: Serialize + for<'de> Deserialize<'de> + Any{}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// A type-unsafe `MessageValue` that can be used to transmute `SerializedMessage` instances.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// This operation is unsafe and can result in deserializing the `SerializedMessage` failing, or even worse, a type confusion.
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
|
|
|
|
pub enum UntypedMessageValue{}
|
|
|
|