pub struct SpscConsumer<T, const N: usize> { /* private fields */ }Expand description
Consumer half of an SpscRing.
Implementations§
Source§impl<T, const N: usize> SpscConsumer<T, N>
impl<T, const N: usize> SpscConsumer<T, N>
Sourcepub const fn pop_async(&self) -> PopFuture<'_, T, N> ⓘ
pub const fn pop_async(&self) -> PopFuture<'_, T, N> ⓘ
Returns a future that resolves to the next buffered item, or None once
the producer has been dropped and the ring is empty.
Sourcepub fn buffered_count(&self) -> usize
pub fn buffered_count(&self) -> usize
Returns the current buffered item count.
pub const fn stream(&self) -> SpscConsumerStream<'_, T, N>
Available on crate feature
futures-stream only.Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for SpscConsumer<T, N>
impl<T, const N: usize> !RefUnwindSafe for SpscConsumer<T, N>
impl<T, const N: usize> Send for SpscConsumer<T, N>where
T: Send,
impl<T, const N: usize> Sync for SpscConsumer<T, N>where
T: Send,
impl<T, const N: usize> Unpin for SpscConsumer<T, N>
impl<T, const N: usize> UnsafeUnpin for SpscConsumer<T, N>
impl<T, const N: usize> !UnwindSafe for SpscConsumer<T, N>
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