pub struct SpscReceiver<T> { /* private fields */ }Expand description
Receiver half of SPSC channel.
The single-consumer half of the pair, !Sync for the same reason as
SpscSender — two shared receivers would assume_init_read one slot
twice, moving out of it and then dropping it twice.
Implementations§
Source§impl<T> SpscReceiver<T>where
T: Send,
impl<T> SpscReceiver<T>where
T: Send,
Sourcepub fn recv(&self) -> Result<T, ChannelError>
pub fn recv(&self) -> Result<T, ChannelError>
Receive a value from the channel, blocking until one arrives.
Sourcepub fn try_recv(&self) -> Result<T, ChannelError>
pub fn try_recv(&self) -> Result<T, ChannelError>
Try to receive a value without blocking.
Trait Implementations§
Source§impl<T> Consumer<T> for SpscReceiver<T>where
T: Send,
impl<T> Consumer<T> for SpscReceiver<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 SpscReceiver<T>
impl<T> Drop for SpscReceiver<T>
Auto Trait Implementations§
impl<T> !Freeze for SpscReceiver<T>
impl<T> !RefUnwindSafe for SpscReceiver<T>
impl<T> !Sync for SpscReceiver<T>
impl<T> !UnwindSafe for SpscReceiver<T>
impl<T> Send for SpscReceiver<T>
impl<T> Unpin for SpscReceiver<T>
impl<T> UnsafeUnpin for SpscReceiver<T>where
Arc<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