Skip to main content

QueueSet3

Struct QueueSet3 

Source
pub struct QueueSet3<'a, T0, T1, T2>
where T0: Copy, T1: Copy, T2: 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> QueueSet3<'a, T0, T1, T2>
where T0: Copy, T1: Copy, T2: Copy,

Source

pub fn new( q0: &'a Queue<T0>, q1: &'a Queue<T1>, q2: &'a Queue<T2>, ) -> 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<QueueSet3Selected<T0, T1, T2>>

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> Drop for QueueSet3<'_, T0, T1, T2>
where T0: Copy, T1: Copy, T2: 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> Send for QueueSet3<'_, T0, T1, T2>
where T0: Send + Sync + Copy, T1: Send + Sync + Copy, T2: Send + Sync + Copy,

Source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a, T0, T1, T2> UnwindSafe for QueueSet3<'a, T0, T1, T2>
where &'a Queue<T0>: UnwindSafe, &'a Queue<T1>: UnwindSafe, &'a Queue<T2>: 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.