Function channel

Source
pub(crate) fn channel<T>() -> (Sender<T>, Receiver<T>)
Expand description

Create a new oneshot broadcast channel.

let (tx, rx) = channel();
let rx_clone = rx.clone();
tx.send(0_u8);
assert_eq!(rx.await, Ok(0));
assert_eq!(rx_clone.await, Ok(0));