pub trait SerdeFile: Serialize + DeserializeOwned {
// Provided methods
fn save(
&self,
fmt: SerializationFormat,
fname: impl AsRef<Path>,
) -> Result<(), Error> { ... }
fn open(
fname: impl AsRef<Path>,
fmt: SerializationFormat,
) -> Result<Self, Error> { ... }
}Expand description
Serialization to & from file trait
Includes:
openfor loading from filesavefor saving to file
Fully default-implemented, allowing empty implementations for types that implement serde serialization and deserialization.
Provided Methods§
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.