pub struct Receiver<T> { /* private fields */ }Expand description
Receiving half of a oneshot channel. Implements Future and resolves to the sent value.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub async fn recv(self) -> Result<T, RecvError>
pub async fn recv(self) -> Result<T, RecvError>
Receives the value, parking until it arrives.
Returns Err if the sender was dropped without sending a value.
Sourcepub fn try_recv(&mut self) -> Result<T, TryRecvError>
pub fn try_recv(&mut self) -> Result<T, TryRecvError>
Receives without waiting.
Returns Err(Empty) if no value has been sent yet, or Err(Closed) if the sender was
dropped without sending.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> !Send for Receiver<T>
impl<T> !Sync for Receiver<T>
impl<T> Unpin for Receiver<T>
impl<T> UnsafeUnpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more