pub struct AsyncConsumer<T> { /* private fields */ }Expand description
Async receiving half. Implements Stream.
Implementations§
Source§impl<T> AsyncConsumer<T>
impl<T> AsyncConsumer<T>
Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Pop one item from the prefetched window. Zero atomics.
Call release after draining a batch.
Sourcepub fn release(&mut self)
pub fn release(&mut self)
Publish consumed position so the producer can reuse slots, and wake the producer if it is waiting for space.
Sourcepub fn prefetch(&mut self) -> usize
pub fn prefetch(&mut self) -> usize
Load all items flushed since the last prefetch. One Acquire load.
Sourcepub fn prefetch_and_pop(&mut self) -> Option<T>
pub fn prefetch_and_pop(&mut self) -> Option<T>
Prefetch + pop + release in one call.
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
Trait Implementations§
Source§impl<T> Debug for AsyncConsumer<T>
impl<T> Debug for AsyncConsumer<T>
Source§impl<T> Drop for AsyncConsumer<T>
impl<T> Drop for AsyncConsumer<T>
impl<T: Send> Send for AsyncConsumer<T>
Source§impl<T> Stream for AsyncConsumer<T>
impl<T> Stream for AsyncConsumer<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for AsyncConsumer<T>
impl<T> !UnwindSafe for AsyncConsumer<T>
impl<T> Freeze for AsyncConsumer<T>
impl<T> Sync for AsyncConsumer<T>where
T: Send,
impl<T> Unpin for AsyncConsumer<T>
impl<T> UnsafeUnpin for AsyncConsumer<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