pub struct Producer<'a, T, const N: usize> { /* private fields */ }
Expand description
A queue “producer”; it can enqueue items into the queue
NOTE the producer semantically owns the tail
pointer of the queue
Implementations§
source§impl<'a, T, const N: usize> Producer<'a, T, N>
impl<'a, T, const N: usize> Producer<'a, T, N>
sourcepub fn enqueue(&mut self, val: T) -> Result<(), T>
pub fn enqueue(&mut self, val: T) -> Result<(), T>
Adds an item
to the end of the queue, returns back the item
if the queue is full
sourcepub unsafe fn enqueue_unchecked(&mut self, val: T)
pub unsafe fn enqueue_unchecked(&mut self, val: T)
Adds an item
to the end of the queue, without checking if the queue is full
See Queue::enqueue_unchecked
for safety
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for Producer<'a, T, N>
impl<'a, T, const N: usize> !RefUnwindSafe for Producer<'a, T, N>
impl<'a, T, const N: usize> !Sync for Producer<'a, T, N>
impl<'a, T, const N: usize> Unpin for Producer<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for Producer<'a, 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