pub struct Queue<T: Sized + Send> { /* private fields */ }Expand description
A queue with a finite size.
Implementations§
Source§impl<T: Sized + Send> Queue<T>
impl<T: Sized + Send> Queue<T>
pub fn new(max_size: usize) -> Result<Queue<T>, FreeRtosError>
Sourcepub unsafe fn from_raw_handle(handle: FreeRtosQueueHandle) -> Self
pub unsafe fn from_raw_handle(handle: FreeRtosQueueHandle) -> Self
§Safety
handle must be a valid FreeRTOS regular queue handle (not semaphore or mutex).
The item size of the queue must match the size of T.
pub fn raw_handle(&self) -> FreeRtosQueueHandle
Sourcepub fn send<D: DurationTicks>(
&self,
item: T,
max_wait: D,
) -> Result<(), SendError<T>>
pub fn send<D: DurationTicks>( &self, item: T, max_wait: D, ) -> Result<(), SendError<T>>
Send an item to the end of the queue. Wait for the queue to have empty space for it.
Sourcepub fn send_from_isr(
&self,
context: &mut InterruptContext,
item: T,
) -> Result<(), SendError<T>>
pub fn send_from_isr( &self, context: &mut InterruptContext, item: T, ) -> Result<(), SendError<T>>
Send an item to the end of the queue, from an interrupt.
Sourcepub fn receive<D: DurationTicks>(&self, max_wait: D) -> Result<T, FreeRtosError>
pub fn receive<D: DurationTicks>(&self, max_wait: D) -> Result<T, FreeRtosError>
Wait for an item to be available on the queue.