Crate catty

Crate catty 

Source
Expand description

Send a value and asynchronously wait for it.

§Example

let (tx, rx) = catty::oneshot();
tx.send("Hello!");
assert_eq!(rx.await, Ok("Hello!"));

Structs§

Disconnected
The sender side has disconnected.
Receiver
The receiver side of a oneshot channel, created with catty::oneshot. This is a future resolving to item, or an error if the sender side has been dropped without sending a message. After a message is received, subsequent polls will return Err(Disconnected).
Sender
The sender side of a oneshot channel, created with catty::oneshot. A value can be sent into the channel to be waited on by the receiver.

Functions§

oneshot
Creates a oneshot channel. A value can be sent into this channel and then be asynchronously waited for.