Trait 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.

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.

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§