Skip to main content

QueueSet4

Struct QueueSet4 

Source
pub struct QueueSet4<'a, T0, T1, T2, T3>
where T0: Copy, T1: Copy, T2: Copy, T3: Copy,
{ /* private fields */ }
Expand description

A FreeRTOS queue set that monitors a fixed number of queues of (potentially) different item types.

Construct with new, then call select_from_set to block until any member queue has an item ready. The item is automatically received and returned inside the typed enum.

§FreeRTOS constraints

  • All queues must be empty when new is called.
  • A queue may only belong to one queue set at a time.
  • The combined capacity of all queues must not be zero.

Implementations§

Source§

impl<'a, T0, T1, T2, T3> QueueSet4<'a, T0, T1, T2, T3>
where T0: Copy, T1: Copy, T2: Copy, T3: Copy,

Source

pub fn new( q0: &'a Queue<T0>, q1: &'a Queue<T1>, q2: &'a Queue<T2>, q3: &'a Queue<T3>, ) -> Result<Self, EspError>

Create a new queue set monitoring all supplied queues.

The FreeRTOS event-queue length is computed as the sum of the capacities of all member queues. All queues must be empty at the time of the call. On failure (queue not empty, already in a set, etc.) all previously added queues are removed and the set handle is deleted before returning the error.

Source

pub fn select_from_set( &self, timeout: TickType_t, ) -> Option<QueueSet4Selected<T0, T1, T2, T3>>

Block until one of the member queues has an item available, or until timeout ticks elapse.

On success the item is automatically received from the ready queue and returned inside the enum variant. Returns None on timeout.

§ISR safety

Dispatches to xQueueSelectFromSetFromISR when called from an ISR context, otherwise uses xQueueSelectFromSet.

Trait Implementations§

Source§

impl<T0, T1, T2, T3> Drop for QueueSet4<'_, T0, T1, T2, T3>
where T0: Copy, T1: Copy, T2: Copy, T3: Copy,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<T0, T1, T2, T3> Send for QueueSet4<'_, T0, T1, T2, T3>
where T0: Send + Sync + Copy, T1: Send + Sync + Copy, T2: Send + Sync + Copy, T3: Send + Sync + Copy,

Source§

impl<T0, T1, T2, T3> Sync for QueueSet4<'_, T0, T1, T2, T3>
where T0: Send + Sync + Copy, T1: Send + Sync + Copy, T2: Send + Sync + Copy, T3: Send + Sync + Copy,

Auto Trait Implementations§

§

impl<'a, T0, T1, T2, T3> Freeze for QueueSet4<'a, T0, T1, T2, T3>
where &'a Queue<T0>: Freeze, &'a Queue<T1>: Freeze, &'a Queue<T2>: Freeze, &'a Queue<T3>: Freeze,

§

impl<'a, T0, T1, T2, T3> RefUnwindSafe for QueueSet4<'a, T0, T1, T2, T3>
where &'a Queue<T0>: RefUnwindSafe, &'a Queue<T1>: RefUnwindSafe, &'a Queue<T2>: RefUnwindSafe, &'a Queue<T3>: RefUnwindSafe,

§

impl<'a, T0, T1, T2, T3> Unpin for QueueSet4<'a, T0, T1, T2, T3>
where &'a Queue<T0>: Unpin, &'a Queue<T1>: Unpin, &'a Queue<T2>: Unpin, &'a Queue<T3>: Unpin,

§

impl<'a, T0, T1, T2, T3> UnsafeUnpin for QueueSet4<'a, T0, T1, T2, T3>
where &'a Queue<T0>: UnsafeUnpin, &'a Queue<T1>: UnsafeUnpin, &'a Queue<T2>: UnsafeUnpin, &'a Queue<T3>: UnsafeUnpin,

§

impl<'a, T0, T1, T2, T3> UnwindSafe for QueueSet4<'a, T0, T1, T2, T3>
where &'a Queue<T0>: UnwindSafe, &'a Queue<T1>: UnwindSafe, &'a Queue<T2>: UnwindSafe, &'a Queue<T3>: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.