Module tor_async_utils::oneshot
source · Expand description
Thin veneer over futures::channel::oneshot to fix use with select!
A bare [futures::channel::oneshot::Receiver] doesn’t work properly with
futures::select!, because it has a broken
FusedFuture
implementation.
(See futures-rs ticket #2455.)
Wrapping it up in a future::Fuse works around this,
with a minor performance penalty.
Limitations
The API of this Receiver is rather more limited.
For example, it lacks .try_recv().
Structs
- Error returned from a [
Receiver] when the corresponding [Sender] is dropped.
Functions
- Return a fresh oneshot channel
Type Aliases
oneshot::Receiverthat works properly with [futures::select!]oneshot::Sendertype alias