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> Freeze for ReceiverRef<'a, T>
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§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?
§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more