pub struct Consumer<T> { /* private fields */ }Expand description
Consumer handle for popping items from the ring buffer.
This type is Send but not Clone - only one consumer should exist.
Implementations§
Source§impl<T> Consumer<T>
impl<T> Consumer<T>
Sourcepub fn try_pop(&mut self) -> Option<T>
pub fn try_pop(&mut self) -> Option<T>
Attempts to pop a value from the buffer.
Returns Some(value) if successful, or None if the buffer is empty.
This operation is lock-free and will never block.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Consumer<T>
impl<T> !RefUnwindSafe for Consumer<T>
impl<T> Sync for Consumer<T>where
T: Send,
impl<T> Unpin for Consumer<T>
impl<T> !UnwindSafe 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