pub struct Receiver<'a, T, const N: usize>(/* private fields */);
Expand description
A receiver of the channel. There can only be one receiver at any time.
Implementations§
source§impl<'a, T, const N: usize> Receiver<'a, T, N>
impl<'a, T, const N: usize> Receiver<'a, T, N>
sourcepub fn try_recv(&mut self) -> Result<T, ReceiveError>
pub fn try_recv(&mut self) -> Result<T, ReceiveError>
Receives a value if there is one in the channel, non-blocking.
sourcepub async fn recv(&mut self) -> Result<T, ReceiveError>
pub async fn recv(&mut self) -> Result<T, ReceiveError>
Receives a value, waiting if the queue is empty.
If all senders are dropped this will error with NoSender
.
Trait Implementations§
impl<'a, T, const N: usize> Send for Receiver<'a, T, N>
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for Receiver<'a, T, N>
impl<'a, T, const N: usize> !RefUnwindSafe for Receiver<'a, T, N>
impl<'a, T, const N: usize> Sync for Receiver<'a, T, N>
impl<'a, T, const N: usize> Unpin for Receiver<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for Receiver<'a, T, N>
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