Trait any_cache::Cache
[−]
[src]
pub trait Cache { fn save<K, T>(&mut self, key: K, value: T)
where
T: Any + 'static,
K: CacheKey<Target = T>; fn get<K, T>(&self, key: &K) -> Option<&T>
where
T: Any + 'static,
K: CacheKey<Target = T>; fn remove<K, T>(&mut self, key: &K) -> Option<T>
where
T: Any + 'static,
K: CacheKey<Target = T>; fn clear(&mut self); }
A cache that can store abitrary values and namespace them by key types.
Required Methods
fn save<K, T>(&mut self, key: K, value: T) where
T: Any + 'static,
K: CacheKey<Target = T>,
T: Any + 'static,
K: CacheKey<Target = T>,
fn get<K, T>(&self, key: &K) -> Option<&T> where
T: Any + 'static,
K: CacheKey<Target = T>,
T: Any + 'static,
K: CacheKey<Target = T>,
fn remove<K, T>(&mut self, key: &K) -> Option<T> where
T: Any + 'static,
K: CacheKey<Target = T>,
T: Any + 'static,
K: CacheKey<Target = T>,
fn clear(&mut self)
Implementors
impl Cache for HashCache
impl Cache for DummyCache