Expand description
§relay
A light-weight channel using Future. A relay channel does not implement
Send, and so is not meant for synchronizing between threads. Instead,
its used to send message between tasks that live in the same thread.
It is similar to the oneshot channel in the futures crate, but since
it is not meant for sending across threads, it performs about twice as
fast.
§Example
let (tx, rx) = relay::channel();
tx.complete("foo");
assert_eq!(rx.wait().unwrap(), "foo");Structs§
- Canceled
- Represents that the
Senderdropped before sending a message. - Receiver
- The receiver end of the channel.
- Sender
- The Sender portion of a channel.
- Waiting
- A
Futurewaiting for interest to be registered on theReceiver.
Functions§
- channel
- Create a new channel to send a message.