Trait CacheStore

Source
pub trait CacheStore<Value> {
    // Required methods
    fn store<T: Into<String>>(&mut self, cache_id: T, token: Value);
    fn get(&self, cache_id: &str) -> Option<Value>;
    fn evict(&self, cache_id: &str) -> Option<Value>;
}

Required Methods§

Source

fn store<T: Into<String>>(&mut self, cache_id: T, token: Value)

Store Value given cache id.

Source

fn get(&self, cache_id: &str) -> Option<Value>

Get Value from cache given matching cache id.

Source

fn evict(&self, cache_id: &str) -> Option<Value>

Evict or remove value from cache given cache id.

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§

Source§

impl<Value: Clone> CacheStore<Value> for InMemoryCacheStore<Value>