Module oneshot

Source
Expand description

§One shot SPSC channels

Very simple single-use channels with a sync and async API, blocking/non-blocking. This builds on Slot<T>, so the item has to be boxed. Most useful for the transfer of return values in the context of remote procedure calling, as “reply pipes”.

let (tx, rx) = async_fifo::oneshot();
 
let item = 72u8;
tx.send(Box::new(item));
 
assert_eq!(*rx.await, item);

Structs§

Receiver
The reading side of the oneshot channel
Sender
The writing side of the oneshot channel

Functions§

new
Create a new oneshot channel, returning a sender/receiver pair