pub struct Consumer<T> { /* private fields */ }Expand description
Receiving half. Send but not Sync.
Implementations§
Source§impl<T> Consumer<T>
impl<T> Consumer<T>
Sourcepub fn release(&mut self)
pub fn release(&mut self)
Publish consumed position so the producer can reuse slots. One Release store. Call after draining a batch of pops.
Sourcepub fn prefetch(&mut self) -> usize
pub fn prefetch(&mut self) -> usize
Load all items flushed since the last prefetch. One Acquire load. Returns the count of newly available items.
Sourcepub fn prefetch_and_pop(&mut self) -> Option<T>
pub fn prefetch_and_pop(&mut self) -> Option<T>
Convenience: prefetch + pop + release. For callers that don’t need batching.
pub fn is_empty(&self) -> bool
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
The producer has been dropped and all flushed items have been consumed. No more data will ever arrive.
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
Trait Implementations§
impl<T: Send> Send for Consumer<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Consumer<T>
impl<T> !UnwindSafe for Consumer<T>
impl<T> Freeze for Consumer<T>
impl<T> Sync for Consumer<T>where
T: Send,
impl<T> Unpin for Consumer<T>
impl<T> UnsafeUnpin for Consumer<T>
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