Cache

Trait Cache 

Source
pub trait Cache:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn read(&self, key: &dyn CacheKey) -> Result<Option<Vec<u8>>>;
    fn write(&self, key: &dyn CacheKey, value: &[u8]) -> Result<()>;
    fn path(&self, key: &dyn CacheKey) -> PathBuf;
    fn clear(&self) -> Result<()>;
    fn clone_box(&self) -> Box<dyn Cache>;
}

Required Methods§

Source

fn read(&self, key: &dyn CacheKey) -> Result<Option<Vec<u8>>>

Source

fn write(&self, key: &dyn CacheKey, value: &[u8]) -> Result<()>

Source

fn path(&self, key: &dyn CacheKey) -> PathBuf

Source

fn clear(&self) -> Result<()>

Source

fn clone_box(&self) -> Box<dyn Cache>

Trait Implementations§

Source§

impl Clone for Box<dyn Cache>

Source§

fn clone(&self) -> Box<dyn Cache>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§