pub fn insert_permanent(&self, key: K, val: V) -> Option<V> {
        match self.inner.write().entry(key) {
            Entry::Vacant(entry) => {
                debug!(key = ?entry.key(), "Permanently caching new value");
                entry.insert(CacheEntry::permanent(val));
                None
            }
            Entry::Occupied(ref mut entry) => {
                debug!(key = ?entry.key(), "Updating permanently cached value");
                let prior_entry = entry.insert(CacheEntry::permanent(val));
                Some(prior_entry.value)
            }
        }
    }
/// Adds or overwrites a value in the cache that will never be evicted from
/// the cache.
Adds or overwrites a value in the cache that will never be evicted from
the cache.
Adds or overwrites a value in the cache that will never be evicted from the cache .
pub fn insert_permanent(&self, key: K, val: V) -> Option<V> {
        match self.inner.write().entry(key) {
            Entry::Vacant(entry) => {
                debug!(key = ?entry.key(), "Permanently caching new value");
                entry.insert(CacheEntry::permanent(val));
                None
            }
            Entry::Occupied(ref mut entry) => {
                debug!(key = ?entry.key(), "Updating permanently cached value");
                let prior_entry = entry.insert(CacheEntry::permanent(val));
                Some(prior_entry.value)
            }
        }
    }
pub fn insert_permanent ( & self , key : K , val : V ) -> Option < V > { match self . inner . write ( ) . entry ( key ) { Entry :: Vacant ( entry ) => { debug ! ( key entry key ( ) " " ) ; entry . insert ( CacheEntry :: permanent ( val ) ) ; None } Entry :: Occupied ( ref mut entry ) => { debug ! ( key entry key ( ) " " ) ; let prior_entry = entry . insert ( CacheEntry :: permanent ( val ) ) ; Some ( prior_entry . value ) } } }
Adds or overwrites a value in the cache that will never be evicted from
the cache.
Adds or overwrites a value in the cache that will never be evicted from the cache .
&self
key
K
val
V