hirofa_utils::cache

Trait CacheIFace

Source
pub trait CacheIFace<K: Eq, O> {
    // Required methods
    fn invalidate_all(&mut self);
    fn invalidate_stale(&mut self);
    fn opt(&mut self, key: &K) -> Option<&O>;
    fn opt_mut(&mut self, key: &K) -> Option<&mut O>;
    fn opt_no_touch(&self, key: &K) -> Option<&O>;
    fn get(&mut self, key: &K) -> Option<&O>;
    fn get_mut(&mut self, key: &K) -> Option<&mut O>;
    fn contains_key(&self, key: &K) -> bool;
    fn invalidate(&mut self, key: &K);
    fn insert(&mut self, key: K, item: O);
}

Required Methods§

Source

fn invalidate_all(&mut self)

Source

fn invalidate_stale(&mut self)

Source

fn opt(&mut self, key: &K) -> Option<&O>

Source

fn opt_mut(&mut self, key: &K) -> Option<&mut O>

Source

fn opt_no_touch(&self, key: &K) -> Option<&O>

Source

fn get(&mut self, key: &K) -> Option<&O>

Source

fn get_mut(&mut self, key: &K) -> Option<&mut O>

Source

fn contains_key(&self, key: &K) -> bool

Source

fn invalidate(&mut self, key: &K)

Source

fn insert(&mut self, key: K, item: O)

Implementors§

Source§

impl<K: Eq + Hash + Clone, O> CacheIFace<K, O> for Cache<K, O>