pub struct Receiver<T, const N: usize> { /* private fields */ }Expand description
The receiving half of a channel.
Receivers can be cloned to allow multiple consumers.
Implementations§
Source§impl<T, const N: usize> Receiver<T, N>
impl<T, const N: usize> Receiver<T, N>
pub fn recv_batch(&self, buf: &mut [T], max: usize) -> usize
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Result<T>
pub fn recv_timeout(&self, timeout: Duration) -> Result<T>
Receives a value with a timeout.
Spins until a value is available or timeout is reached.
§Errors
Returns Err(QueueEmpty) if timeout is reached before a value is available.
Trait Implementations§
impl<T: Send, const N: usize> Send for Receiver<T, N>
impl<T: Send, const N: usize> Sync for Receiver<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Receiver<T, N>
impl<T, const N: usize> !RefUnwindSafe for Receiver<T, N>
impl<T, const N: usize> Unpin for Receiver<T, N>
impl<T, const N: usize> !UnwindSafe for Receiver<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