pub trait SerDe {
// Required methods
fn load<T>(&self) -> Result<T>
where T: for<'de> Deserialize<'de>;
fn save<T>(&self, value: &T) -> Result<()>
where T: Serialize;
}Expand description
Trait to wrap serialization and deserialization functionality behind uniform load and save functions
Required Methods§
Sourcefn load<T>(&self) -> Result<T>where
T: for<'de> Deserialize<'de>,
fn load<T>(&self) -> Result<T>where
T: for<'de> Deserialize<'de>,
Deserialize into a specified type
§Errors
In case the deserialization or the reading fails the return value will contain the first error that occurred.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.