[−][src]Attribute Macro activitystreams_derive::wrapper_type
#[wrapper_type]
Derive a wrapper type based on serde_json::Value to contain any possible trait type
The following code
ⓘThis example is not tested
#[wrapper_type] pub trait Object {}
produces the following type
ⓘThis example is not tested
pub struct ObjectBox(pub serde_json::Value); impl ObjectBox { pub fn from_concrete<T>(t: T) -> Result<Self, std::io::Error> where T: Object + serde::ser::Serialize; pub fn into_concrete<T>(self) -> Result<T, std::io::Error> where T: Object + serde::de::DeserializeOwned; pub fn is_type(&self, kind: impl std::fmt::Display) -> bool; pub fn type(&self) -> Option<&str>; }