Trait Loadable

Source
pub trait Loadable: Serializable {
    // Provided methods
    fn load(data: &[u8]) -> Result<Self>
       where Self: Sized { ... }
    fn save(&self) -> Result<Vec<u8>> { ... }
}
Expand description

Trait for objects that can be loaded from serialized data

Provided Methods§

Source

fn load(data: &[u8]) -> Result<Self>
where Self: Sized,

Load this object from serialized data

Source

fn save(&self) -> Result<Vec<u8>>

Save this object to serialized data

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§