Struct mpmc_async::Receiver
source · pub struct Receiver<T>{ /* private fields */ }
Expand description
Receives messages sent by Sender.
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>
Waits until there’s a message to be read and returns. Returns an error when there are no more messages in the queue and all Senders have been dropped.
sourcepub fn try_recv(&self) -> Result<T, TryRecvError>
pub fn try_recv(&self) -> Result<T, TryRecvError>
Checks if there’s a message to be read and returns immediately. Returns an error when the channel is disconnected or empty.
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> 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