SerializableModel

Trait SerializableModel 

Source
pub trait SerializableModel: Serialize + for<'de> Deserialize<'de> {
    // Provided methods
    fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()> { ... }
    fn save_to_writer<W: Write>(&self, writer: W) -> Result<()> { ... }
    fn save_to_file_compressed<P: AsRef<Path>>(&self, path: P) -> Result<()> { ... }
    fn load_from_file_compressed<P: AsRef<Path>>(path: P) -> Result<Self> { ... }
    fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self> { ... }
    fn load_from_reader<R: Read>(reader: R) -> Result<Self> { ... }
}
Expand description

Trait for clustering models that can be serialized

Provided Methods§

Source

fn save_to_file<P: AsRef<Path>>(&self, path: P) -> Result<()>

Save the model to a file

Source

fn save_to_writer<W: Write>(&self, writer: W) -> Result<()>

Save the model to a writer

Source

fn save_to_file_compressed<P: AsRef<Path>>(&self, path: P) -> Result<()>

Save the model to a file with compression

Source

fn load_from_file_compressed<P: AsRef<Path>>(path: P) -> Result<Self>

Load the model from a compressed file

Source

fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>

Load the model from a file

Source

fn load_from_reader<R: Read>(reader: R) -> Result<Self>

Load the model from a reader

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§