pub struct Consumer { /* private fields */ }Expand description
Consumer endpoint of the MPSC ring buffer.
Use try_claim to claim the next record for reading.
This type is NOT Clone - only one consumer is allowed.
Implementations§
Source§impl Consumer
impl Consumer
Sourcepub fn try_claim(&mut self) -> Option<ReadClaim<'_>>
pub fn try_claim(&mut self) -> Option<ReadClaim<'_>>
Attempts to claim the next record for reading.
Returns a ReadClaim if a record is available. The claim dereferences
to &[u8] for the payload. When dropped, the record region is zeroed
and the head is advanced.
Returns None if no committed record is available.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns true if all producers have been dropped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Consumer
impl RefUnwindSafe for Consumer
impl Sync for Consumer
impl Unpin for Consumer
impl UnwindSafe for Consumer
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