pub struct OneshotReceiver<T>(/* private fields */);Expand description
Receiver for oneshot channel.
Can only receive a single value.
Implementations§
Source§impl<T> OneshotReceiver<T>
impl<T> OneshotReceiver<T>
Sourcepub fn recv(self) -> Result<T, RecvError>
pub fn recv(self) -> Result<T, RecvError>
Block until the value is received.
§Errors
Returns Err(RecvError) if the sender was dropped without sending.
Sourcepub fn try_recv(&self) -> Result<T, TryRecvError>
pub fn try_recv(&self) -> Result<T, TryRecvError>
Try to receive without blocking.
§Errors
Returns Err(TryRecvError::Empty) if no value is available yet,
or Err(TryRecvError::Disconnected) if the sender was dropped.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for OneshotReceiver<T>
impl<T> RefUnwindSafe for OneshotReceiver<T>
impl<T> Send for OneshotReceiver<T>where
T: Send,
impl<T> !Sync for OneshotReceiver<T>
impl<T> Unpin for OneshotReceiver<T>
impl<T> UnsafeUnpin for OneshotReceiver<T>
impl<T> UnwindSafe for OneshotReceiver<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