pub async fn fetch(
        &self,
        key: K,
    ) -> Option<V> {
        let (sender, receiver) = oneshot::channel();

        // Tell the worker thread to give us a value matching the key.
        //
        // It shouldn't be possible for this to fail, since the worker holds
        // the receiver for this channel, and isn't dropped until the client
        // itself is dropped.  So if it does fail, we want to know about it
        // since it would mean we have a bug.
        self.work_in
            .unbounded_send(WorkerMessage::Give {
                key,
                return_sender: sender,
            })
            .expect("worker messager receiver dropped unexpectedly");

        // Wait for the worker thread to either give us the value back or tell
        // us (via error) that it didn't have one to give us.
        receiver.await.ok()
    }
/// Attempt to retrieve the value previously stored with [`store`] using
/// the given key.  If no value was stored with that key, or the
/// [`perished`] future for the value stored with that key has completed,
/// `None` is returned.
///
/// This function is asynchronous because ownership must be completely
/// transfered from the worker thread of the `Pantry`.
///
/// [`perished`]: trait.Perishable.html#method.perished
/// [`store`]: #method.store
Attempt to retrieve the value previously stored with [`store`] using
the given key.  If no value was stored with that key, or the
[`perished`] future for the value stored with that key has completed,
`None` is returned.

This function is asynchronous because ownership must be completely
transfered from the worker thread of the `Pantry`.


Attempt to retrieve the value previously stored with [ ` store ` ] using the given key . If no value was stored with that key or the [ ` perished ` ] future for the value stored with that key has completed ` None ` is returned . This function is asynchronous because ownership must be completely transfered from the worker thread of the ` Pantry ` .
pub async fn fetch(
        &self,
        key: K,
    ) -> Option<V> {
        let (sender, receiver) = oneshot::channel();
        // Tell the worker thread to give us a value matching the key.
        //
        // It shouldn't be possible for this to fail, since the worker holds
        // the receiver for this channel, and isn't dropped until the client
        // itself is dropped.  So if it does fail, we want to know about it
        // since it would mean we have a bug.
        self.work_in
            .unbounded_send(WorkerMessage::Give {
                key,
                return_sender: sender,
            })
            .expect("worker messager receiver dropped unexpectedly");
        // Wait for the worker thread to either give us the value back or tell
        // us (via error) that it didn't have one to give us.
        receiver.await.ok()
    }
pub async fn fetch ( & self , key : K , ) -> Option < V > { let ( sender , receiver ) = oneshot :: channel ( ) ; // Tell the worker thread to give us a value matching the key. // // It shouldn't be possible for this to fail, since the worker holds // the receiver for this channel, and isn't dropped until the client // itself is dropped.  So if it does fail, we want to know about it // since it would mean we have a bug. self . work_in . unbounded_send ( WorkerMessage :: Give { key , return_sender : sender , } ) . expect ( " " ) ; // Wait for the worker thread to either give us the value back or tell // us (via error) that it didn't have one to give us. receiver . await . ok ( ) }
Attempt to retrieve the value previously stored with [`store`] using
the given key.
Attempt to retrieve the value previously stored with [ ` store ` ] using the given key .
&self
key
K
&self
key
K