pub struct SpscConsumer<'ring, T> { /* private fields */ }Expand description
The receiving half of a borrowed SpscRing.
Implementations§
Source§impl<T> SpscConsumer<'_, T>where
T: Send,
impl<T> SpscConsumer<'_, T>where
T: Send,
Sourcepub fn recv(&self) -> Result<T, ChannelError>
pub fn recv(&self) -> Result<T, ChannelError>
Receive a value, blocking until one arrives.
§Errors
Closed once the producer has been dropped and the ring is drained.
Sourcepub fn try_recv(&self) -> Result<T, ChannelError>
pub fn try_recv(&self) -> Result<T, ChannelError>
Receive a value, or report
ChannelError::Empty rather than
waiting.
§Errors
Empty when nothing is queued, Closed once the producer has been
dropped and the ring is drained.
Trait Implementations§
Source§impl<T> Consumer<T> for SpscConsumer<'_, T>where
T: Send,
impl<T> Consumer<T> for SpscConsumer<'_, T>where
T: Send,
Source§fn recv(&self) -> Result<T, ChannelError>
fn recv(&self) -> Result<T, ChannelError>
Receive a value, blocking until one arrives.
Source§fn try_recv(&self) -> Result<T, ChannelError>
fn try_recv(&self) -> Result<T, ChannelError>
Receive a value, or report
ChannelError::Empty rather than waiting.Source§impl<T> Drop for SpscConsumer<'_, T>
impl<T> Drop for SpscConsumer<'_, T>
Auto Trait Implementations§
impl<'ring, T> !Freeze for SpscConsumer<'ring, T>
impl<'ring, T> !RefUnwindSafe for SpscConsumer<'ring, T>
impl<'ring, T> !Sync for SpscConsumer<'ring, T>
impl<'ring, T> !UnwindSafe for SpscConsumer<'ring, T>
impl<'ring, T> Send for SpscConsumer<'ring, T>where
&'ring SpscChannel<T>: Send,
impl<'ring, T> Unpin for SpscConsumer<'ring, T>where
&'ring SpscChannel<T>: Unpin,
impl<'ring, T> UnsafeUnpin for SpscConsumer<'ring, T>where
&'ring SpscChannel<T>: UnsafeUnpin,
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