Struct async_unsync::oneshot::ReceiverRef
source · pub struct ReceiverRef<'a, T> { /* private fields */ }
Expand description
A borrowing handle for receiving elements through a split
OneshotChannel
.
Note
This receiver implements Future
and can be awaited directly:
let mut chan = async_unsync::oneshot::channel();
let (tx, rx) = chan.split();
tx.send(()).unwrap();
let _ = rx.await;
Implementations§
source§impl<T> ReceiverRef<'_, T>
impl<T> ReceiverRef<'_, T>
sourcepub fn close(&mut self)
pub fn close(&mut self)
Closes the channel, causing any closed
or
subsequent poll_closed
calls to resolve and
any subsequent send
s to fail on the corresponding
SenderRef
.
sourcepub fn try_recv(&mut self) -> Result<T, TryRecvError>
pub fn try_recv(&mut self) -> Result<T, TryRecvError>
Trait Implementations§
source§impl<T> Debug for ReceiverRef<'_, T>where
T: Debug,
impl<T> Debug for ReceiverRef<'_, T>where T: Debug,
source§impl<T> Drop for ReceiverRef<'_, T>
impl<T> Drop for ReceiverRef<'_, T>
source§impl<T> Future for ReceiverRef<'_, T>
impl<T> Future for ReceiverRef<'_, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for ReceiverRef<'a, T>
impl<'a, T> !Send for ReceiverRef<'a, T>
impl<'a, T> !Sync for ReceiverRef<'a, T>
impl<'a, T> Unpin for ReceiverRef<'a, T>
impl<'a, T> !UnwindSafe for ReceiverRef<'a, T>
Blanket Implementations§
source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere F: Future,
§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more