pub trait JsonSerializationType<'de>: Sized {
type T: From<Self> + Into<Self> + Serialize + Deserialize<'de>;
fn try_from_json(s: &'de str) -> Result<Self, Error> { ... }
fn try_into_json(self) -> Result<String, Error> { ... }
}
Expand description
This trait annotates a given type its corresponding json serialization type, and provide utility functions to easily convert between them
Required Associated Types
Provided Methods
sourcefn try_from_json(s: &'de str) -> Result<Self, Error>
fn try_from_json(s: &'de str) -> Result<Self, Error>
Construct from json string
sourcefn try_into_json(self) -> Result<String, Error>
fn try_into_json(self) -> Result<String, Error>
Convert into json string