pub struct MpscConsumer { /* private fields */ }Expand description
The single consumer handle. Drains all N producer rings
round-robin; !Sync + !Clone + Send so the compiler enforces
a single consumer.
Implementations§
Source§impl MpscConsumer
impl MpscConsumer
Sourcepub fn try_pop(&self, out: &mut [u8]) -> Result<usize, RingError>
pub fn try_pop(&self, out: &mut [u8]) -> Result<usize, RingError>
Drain one item, round-robin across all N producer rings.
Returns Ok on the first ring that has an item;
Err(Empty) only if every ring is empty.
Sourcepub fn n_producers(&self) -> usize
pub fn n_producers(&self) -> usize
Number of producer rings this consumer drains.
Sourcepub fn approx_total_len(&self) -> usize
pub fn approx_total_len(&self) -> usize
Total approximate items waiting across all producer rings.
Auto Trait Implementations§
impl !Freeze for MpscConsumer
impl !RefUnwindSafe for MpscConsumer
impl !Sync for MpscConsumer
impl !UnwindSafe for MpscConsumer
impl Send for MpscConsumer
impl Unpin for MpscConsumer
impl UnsafeUnpin for MpscConsumer
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