logo
pub trait Cache {
    fn save<K>(&mut self, key: K, value: K::Target)
    where
        K::Target: Any + 'static,
        K: CacheKey
; fn get<K>(&self, key: &K) -> Option<&K::Target>
    where
        K::Target: Any + 'static,
        K: CacheKey
; fn remove<K>(&mut self, key: &K) -> Option<K::Target>
    where
        K::Target: Any + 'static,
        K: CacheKey
; fn clear(&mut self); }
Expand description

A cache that can store arbitrary values and namespace them by key types.

Required Methods

Save item in cache

Get item from cache

Remove item from cache

Clear cache

Implementors