pub struct Queue<T: Sized + Copy> { /* private fields */ }
Expand description
A queue with a finite size. The items are owned by the queue and are copied.
Implementations§
Source§impl<T: Sized + Copy> Queue<T>
impl<T: Sized + Copy> Queue<T>
pub fn new(max_size: usize) -> Result<Queue<T>, FreeRtosError>
Sourcepub fn send<D: DurationTicks>(
&self,
item: T,
max_wait: D,
) -> Result<(), FreeRtosError>
pub fn send<D: DurationTicks>( &self, item: T, max_wait: D, ) -> Result<(), FreeRtosError>
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<(), FreeRtosError>
pub fn send_from_isr( &self, context: &mut InterruptContext, item: T, ) -> Result<(), FreeRtosError>
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.
Trait Implementations§
impl<T: Sized + Copy> Send for Queue<T>
impl<T: Sized + Copy> Sync for Queue<T>
Auto Trait Implementations§
impl<T> Freeze for Queue<T>
impl<T> RefUnwindSafe for Queue<T>where
T: RefUnwindSafe,
impl<T> Unpin for Queue<T>where
T: Unpin,
impl<T> UnwindSafe for Queue<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more