Trait graph_core::cache::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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