Struct heapless::spsc::Producer[][src]

pub struct Producer<'a, T, N, U = usize, C = MultiCore> where
    N: ArrayLength<T>,
    U: Uxx,
    C: XCore, 
{ /* fields omitted */ }
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

Returns the maximum number of elements the queue can hold

Returns the number of elements in the queue

Note

This is a conservative estimate. Interrupt during this function might cause that the Producer actually has more than N items of available space.

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.

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

Returns the maximum number of elements the queue can hold

Returns the number of elements in the queue

Note

This is a conservative estimate. Interrupt during this function might cause that the Producer actually has more than N items of available space.

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.

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

Returns the maximum number of elements the queue can hold

Returns the number of elements in the queue

Note

This is a conservative estimate. Interrupt during this function might cause that the Producer actually has more than N items of available space.

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

Performs the conversion.

Performs the conversion.

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.