parent
ab97278dbd
commit
7765c33070
@ -0,0 +1,26 @@
|
||||
//! Message values
|
||||
use super::*;
|
||||
|
||||
/// A value that can be used for messages.
|
||||
pub trait MessageValue: Serialize + for<'de> Deserialize<'de>{}
|
||||
|
||||
impl<T: ?Sized> MessageValue for T
|
||||
where T: Serialize + for<'de> Deserialize<'de>{}
|
||||
|
||||
/*
|
||||
|
||||
use std::any::Any;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct DynamicMessageValue<T>(T)
|
||||
where T: Any + 'static;
|
||||
|
||||
|
||||
pub struct MessageValueAnyRef<'a>(&'a (dyn Any +'static));
|
||||
pub struct MessageValueAnyMut<'a>(&'a mut (dyn Any +'static));
|
||||
pub struct MessageValueAny(Box<dyn Any +'static>);
|
||||
|
||||
//impl<T> MessageValue for DynamicMessageValue<T>
|
||||
//where T: Serialize + for<'de> Deserialize<'de> + Any{}
|
||||
*/
|
Loading…
Reference in new issue