pub struct AsyncQueueReceiver<T>(/* private fields */);Expand description
An asynchronous queue receiver. Can be used to receive data from an AsyncQueueSender. Use channel to create.
For a purely blocking queue, see Queue.
Implementations§
Source§impl<T> AsyncQueueReceiver<T>
impl<T> AsyncQueueReceiver<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 receive_blocking(
&mut self,
max_wait: Duration,
) -> Result<T, FreeRtosError>
pub fn receive_blocking( &mut self, max_wait: Duration, ) -> Result<T, FreeRtosError>
Waits for an item to be available on the queue.
Returns an item if available and an error if no item is available after max_wait.
Sourcepub async fn receive(&mut self) -> T
pub async fn receive(&mut self) -> T
Asynchronous version of receive_blocking.
This function stays pending until the queue has received an item.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AsyncQueueReceiver<T>
impl<T> !RefUnwindSafe for AsyncQueueReceiver<T>
impl<T> Send for AsyncQueueReceiver<T>
impl<T> Sync for AsyncQueueReceiver<T>
impl<T> Unpin for AsyncQueueReceiver<T>
impl<T> !UnwindSafe for AsyncQueueReceiver<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