Trait ObjectCache

Source
pub trait ObjectCache<K: Key, V: Value>: Send + Sync {
    // Required methods
    fn lookup_or_reserve<'a>(&'a self, key: &K) -> ObjectCacheResult<'_, V>;
    fn invalidate(&self, key: K, value: Option<V>);
}

Required Methods§

Source

fn lookup_or_reserve<'a>(&'a self, key: &K) -> ObjectCacheResult<'_, V>

Looks up a key in the cache and may return a cached value for it. See ObjectCacheResult.

Source

fn invalidate(&self, key: K, value: Option<V>)

Removes key from cache if value is None, invalidates the results of placeholders that have not been resolved. When value is provided then the value may be inserted, and may replace an existing value.

Implementors§

Source§

impl<K: Key, V: Value> ObjectCache<K, V> for NullCache