Struct heapless::ring_buffer::Producer [−][src]
pub struct Producer<'a, T, N, U = usize> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
U: Uxx, { /* fields omitted */ }
A ring buffer "producer"; it can enqueue items into the ring buffer
Methods
impl<'a, T, N> Producer<'a, T, N, u8> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
[src]
impl<'a, T, N> Producer<'a, T, N, u8> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
pub fn ready(&self) -> bool
[src]
pub fn ready(&self) -> bool
Returns if there is any space to enqueue a new item. When this returns true, at least the first subsequent enqueue will succeed.
pub fn enqueue(&mut self, item: T) -> Result<(), T>
[src]
pub fn enqueue(&mut self, item: T) -> Result<(), T>
Adds an item
to the end of the queue
Returns back the item
if the queue is full
pub fn enqueue_unchecked(&mut self, item: T)
[src]
pub fn enqueue_unchecked(&mut self, item: T)
Adds an item
to the end of the queue without checking if it's full
WARNING If the queue is full this operation will make the queue appear empty to
the Consumer
, thus leaking (destructors won't run) all the elements that were in
the queue.
impl<'a, T, N> Producer<'a, T, N, u16> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
[src]
impl<'a, T, N> Producer<'a, T, N, u16> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
pub fn ready(&self) -> bool
[src]
pub fn ready(&self) -> bool
Returns if there is any space to enqueue a new item. When this returns true, at least the first subsequent enqueue will succeed.
pub fn enqueue(&mut self, item: T) -> Result<(), T>
[src]
pub fn enqueue(&mut self, item: T) -> Result<(), T>
Adds an item
to the end of the queue
Returns back the item
if the queue is full
pub fn enqueue_unchecked(&mut self, item: T)
[src]
pub fn enqueue_unchecked(&mut self, item: T)
Adds an item
to the end of the queue without checking if it's full
WARNING If the queue is full this operation will make the queue appear empty to
the Consumer
, thus leaking (destructors won't run) all the elements that were in
the queue.
impl<'a, T, N> Producer<'a, T, N, usize> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
[src]
impl<'a, T, N> Producer<'a, T, N, usize> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
pub fn ready(&self) -> bool
[src]
pub fn ready(&self) -> bool
Returns if there is any space to enqueue a new item. When this returns true, at least the first subsequent enqueue will succeed.
pub fn enqueue(&mut self, item: T) -> Result<(), T>
[src]
pub fn enqueue(&mut self, item: T) -> Result<(), T>
Adds an item
to the end of the queue
Returns back the item
if the queue is full
pub fn enqueue_unchecked(&mut self, item: T)
[src]
pub fn enqueue_unchecked(&mut self, item: T)
Adds an item
to the end of the queue without checking if it's full
WARNING If the queue is full this operation will make the queue appear empty to
the Consumer
, thus leaking (destructors won't run) all the elements that were in
the queue.
Trait Implementations
impl<'a, T, N, U> Send for Producer<'a, T, N, U> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
T: Send,
U: Uxx,
[src]
impl<'a, T, N, U> Send for Producer<'a, T, N, U> where
N: Add<U1> + Unsigned,
Sum<N, U1>: ArrayLength<T>,
T: Send,
U: Uxx,