ThreadSafeCacheTrait

Trait ThreadSafeCacheTrait 

Source
pub trait ThreadSafeCacheTrait<K: 'static + Clone + Eq + Hash + Serialize + DeserializeOwned, V: Clone + Serialize + DeserializeOwned + 'static> {
    // Required methods
    fn put(&mut self, key: K, val: V)
       where K: Eq + Hash;
    fn put_exp(&mut self, key: K, val: V, expiration: i32)
       where K: Eq + Hash + Clone;
    fn get(&mut self, key: K) -> Option<V>
       where K: Eq + Hash,
             V: Clone;
    fn exists(&mut self, key: K) -> bool;
    fn rm(&mut self, key: K);
}

Required Methods§

Source

fn put(&mut self, key: K, val: V)
where K: Eq + Hash,

Source

fn put_exp(&mut self, key: K, val: V, expiration: i32)
where K: Eq + Hash + Clone,

Source

fn get(&mut self, key: K) -> Option<V>
where K: Eq + Hash, V: Clone,

Source

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

Source

fn rm(&mut self, key: K)

Implementors§