pub struct Receiver<I: Interface> { /* private fields */ }
Expand description
Implementations§
source§impl<I: Interface> Receiver<I>
impl<I: Interface> Receiver<I>
sourcepub async fn recv(&mut self) -> Option<I>
pub async fn recv(&mut self) -> Option<I>
Receives the next value for this receiver.
This method returns None
if the channel has been closed and there are
no remaining messages in the channel’s buffer. This indicates that no
further values can ever be received from this Receiver
. The channel is
closed when all senders have been dropped.
If there are no messages in the channel’s buffer, but the channel has not yet been closed, this method will sleep until a message is sent or the channel is closed.
Trait Implementations§
Auto Trait Implementations§
impl<I> Freeze for Receiver<I>
impl<I> !RefUnwindSafe for Receiver<I>
impl<I> Send for Receiver<I>
impl<I> Sync for Receiver<I>
impl<I> Unpin for Receiver<I>
impl<I> !UnwindSafe for Receiver<I>
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