pub trait ModelStore: Serialize + for<'de> Deserialize<'de> {
// Provided methods
fn to_bytes(&self) -> Result<Vec<u8>, StorageError> { ... }
fn from_bytes(bytes: &[u8]) -> Result<Self, StorageError>
where Self: Sized { ... }
}Expand description
Trait for serializing and deserializing fitted models.
Implementors must be Serialize + Deserialize. The default
implementation uses postcard for compact binary encoding.
Provided Methods§
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self, StorageError>where
Self: Sized,
fn from_bytes(bytes: &[u8]) -> Result<Self, StorageError>where
Self: Sized,
Deserializes a model from bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".