Struct heapless::spsc::Producer

source ·
pub struct Producer<'a, T, N, U = usize, C = MultiCore>where
    N: ArrayLength<T>,
    U: Uxx,
    C: XCore,
{ /* private fields */ }
Expand description

A queue “producer”; it can enqueue items into the queue

Implementations§

Returns if there is any space to enqueue a new item. When this returns true, at least the first subsequent enqueue will succeed.

Adds an item to the end of the queue

Returns back the item if the queue is full

Adds an item to the end of the queue without checking if it’s full

Unsafety

If the queue is full this operation will leak a value (T’s destructor won’t run on the value that got overwritten by item), and will allow the dequeue operation to create a copy of item, which could result in T’s destructor running on item twice.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.