pub struct Producer<T> { /* private fields */ }Expand description
Producer handle for pushing items into the ring buffer.
This type is Send but not Clone - only one producer should exist.
Implementations§
Source§impl<T> Producer<T>
impl<T> Producer<T>
Sourcepub fn try_push(&mut self, value: T) -> Result<(), T>
pub fn try_push(&mut self, value: T) -> Result<(), T>
Attempts to push a value into the buffer.
Returns Ok(()) if successful, or Err(value) if the buffer is full.
This operation is lock-free and will never block.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Producer<T>
impl<T> !RefUnwindSafe for Producer<T>
impl<T> Sync for Producer<T>where
T: Send,
impl<T> Unpin for Producer<T>
impl<T> !UnwindSafe for Producer<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