Trait rustfst::algorithms::lazy::cache::SerializableCache

source ·
pub trait SerializableCache {
    // Required methods
    fn read<P: AsRef<Path>>(path: P) -> Result<Self>
       where Self: Sized;
    fn write<P: AsRef<Path>>(&self, path: P) -> Result<()>;
}
Expand description

Trait definining the methods a cache must implement to be serialized and deserialized.

Required Methods§

source

fn read<P: AsRef<Path>>(path: P) -> Result<Self>
where Self: Sized,

Loads a cache from a file in binary format.

source

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

Writes a cache to a file in binary format.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<C: SerializableCache> SerializableCache for Arc<C>

source§

fn read<P: AsRef<Path>>(path: P) -> Result<Self>
where Self: Sized,

source§

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

Implementors§