pub struct AsyncQueueSender<T>(/* private fields */);Expand description
An asynchronous queue sender. Can be used to send data to an AsyncQueueReceiver. Use channel to create.
For a purely blocking queue, see Queue.
The items are owned by the queue and move ownership when sending.
Implementations§
Source§impl<T> AsyncQueueSender<T>
impl<T> AsyncQueueSender<T>
Sourcepub fn messages_waiting(&self) -> UBaseType_t
pub fn messages_waiting(&self) -> UBaseType_t
Returns the number of messages waiting in the queue.
Sourcepub fn send_blocking(&mut self, item: T, max_wait: Duration) -> Result<(), T>
pub fn send_blocking(&mut self, item: T, max_wait: Duration) -> Result<(), T>
Sends an item to the end of the queue.
Waits for the queue to have empty space for up to max_wait. If max_wait is 0 and the queue is full,
this function returns immediately.
Sourcepub fn send_from_isr(
&mut self,
context: &mut InterruptContext,
item: T,
) -> Result<(), T>
pub fn send_from_isr( &mut self, context: &mut InterruptContext, item: T, ) -> Result<(), T>
Sends an item to the end of the queue, from an interrupt.
Sourcepub async fn send(&mut self, item: T)
pub async fn send(&mut self, item: T)
Asynchronous version of send_blocking.
This function stays pending until the queue has space for the item.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AsyncQueueSender<T>
impl<T> !RefUnwindSafe for AsyncQueueSender<T>
impl<T> Send for AsyncQueueSender<T>
impl<T> Sync for AsyncQueueSender<T>
impl<T> Unpin for AsyncQueueSender<T>
impl<T> !UnwindSafe for AsyncQueueSender<T>
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