Expand description
Channels based on crate::fifo
§Example
let (tx, mut rx) = async_fifo::new();
tx.send_iter(['a', 'b', 'c']);
// Receive one by one
assert_eq!(rx.recv().await, Ok('a'));
assert_eq!(rx.recv().await, Ok('b'));
assert_eq!(rx.recv().await, Ok('c'));
core::mem::drop(tx);
assert_eq!(rx.recv().await, Err(Closed));
Modules§
- non_
blocking - oneshot
- One shot SPSC channels
Structs§
- Closed
- An error type returned when the channel is closed
- Fill
- Future for Fifo consumption
- Receiver
- Asynchronous FIFO receiver
- Recv
- Future for Fifo consumption
- Sender
- Asynchronous FIFO sender
Traits§
- Fill
Storage - Asynchronous variant of
Storage
(Borrowing) - Recv
Storage - Asynchronous variant of
Storage
(Defaulting)
Functions§
- new
- Creates a channel with the default block size
- oneshot
- Create a new oneshot channel, returning a sender/receiver pair