#[wrapper_type]Expand description
Derive a wrapper type based on serde_json::Value to contain any possible trait type
The following code
ⓘ
#[wrapper_type]
pub trait Object {}produces the following type
ⓘ
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>;
}