pub struct Consumer<'a, T, N, U = usize, C = MultiCore>where
N: ArrayLength<T>,
U: Uxx,
C: XCore,{ /* private fields */ }
Expand description
A queue “consumer”; it can dequeue items from the queue
Implementations§
source§impl<'a, T, N, C> Consumer<'a, T, N, usize, C>where
N: ArrayLength<T>,
C: XCore,
impl<'a, T, N, C> Consumer<'a, T, N, usize, C>where
N: ArrayLength<T>,
C: XCore,
sourcepub fn ready(&self) -> bool
pub fn ready(&self) -> bool
Returns if there are any items to dequeue. When this returns true, at least the first subsequent dequeue will succeed.
sourcepub fn dequeue(&mut self) -> Option<T>
pub fn dequeue(&mut self) -> Option<T>
Returns the item in the front of the queue, or None
if the queue is empty
sourcepub unsafe fn dequeue_unchecked(&mut self) -> T
pub unsafe fn dequeue_unchecked(&mut self) -> T
Returns the item in the front of the queue, without checking if it’s empty
Unsafety
If the queue is empty this is equivalent to calling mem::uninitialized