pub fn insert(&mut self, key: K, value: V) -> Option<V> {
        let node = {
            trace!("inserting an item into the cache");
            let dq_key = self.expirations.insert(key.clone(), self.expires);
            Node { dq_key, value }
        };

        if let Some(purge) = self.purge_task.take() {
            purge.notify();
        }

        self.values.insert(key, node).map(|n| n.value)
    }
/// Attempts to insert an item by key.
///
/// If a value is returned, this key has been set to expire after an
/// `expires` span of time.
Attempts to insert an item by key.
If a value is returned, this key has been set to expire after an
`expires` span of time.
Attempts to insert an item by key . If a value is returned this key has been set to expire after an ` expires ` span of time .
pub fn insert(&mut self, key: K, value: V) -> Option<V> {
        let node = {
            trace!("inserting an item into the cache");
            let dq_key = self.expirations.insert(key.clone(), self.expires);
            Node { dq_key, value }
        };
        if let Some(purge) = self.purge_task.take() {
            purge.notify();
        }
        self.values.insert(key, node).map(|n| n.value)
    }
pub fn insert ( & mut self , key : K , value : V ) -> Option < V > { let node = { trace ! ( " " ) ; let dq_key = self . expirations . insert ( key . clone ( ) , self . expires ) ; Node { dq_key , value } } ; if let Some ( purge ) = self . purge_task . take ( ) { purge . notify ( ) ; } self . values . insert ( key , node ) . map ( | n | n . value ) }
Attempts to insert an item by key.
Attempts to insert an item by key .
&mut self
key
K
value
V
&mut self
key
K
value
V