pub struct Producer<T> { /* private fields */ }Expand description
The sending half. Send (move to the producer thread); only this half pushes.
Implementations§
Source§impl<T> Producer<T>
impl<T> Producer<T>
Sourcepub fn push(&mut self, val: T) -> Result<(), T>
pub fn push(&mut self, val: T) -> Result<(), T>
Push val. Returns Err(val) (handing the value back) if the ring is
full, so the caller can retry after the consumer drains.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Producer<T>
impl<T> !UnwindSafe for Producer<T>
impl<T> Freeze for Producer<T>
impl<T> Send for Producer<T>where
T: Send,
impl<T> Sync for Producer<T>where
T: Send,
impl<T> Unpin for Producer<T>
impl<T> UnsafeUnpin 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