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