logo

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

The sender side has disconnected.

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).

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

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