Persistent

Trait Persistent 

Source
pub trait Persistent: Serialize + Deserialize {
    // Required methods
    fn save(&self, path: &str) -> Result<(), AnyError>;
    fn load(path: &str) -> Result<Self, AnyError>;
}
Expand description

Allow saving and loading to/from disk

Automatically implemented for types that implement both Serialize and Deserialize

Required Methods§

Source

fn save(&self, path: &str) -> Result<(), AnyError>

Source

fn load(path: &str) -> Result<Self, AnyError>

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.

Implementors§