2 unstable releases

0.2.0 Sep 30, 2024
0.1.0 Sep 3, 2024

#2193 in Rust patterns

Download history 878/week @ 2024-09-03 320/week @ 2024-09-10 314/week @ 2024-09-17 1003/week @ 2024-09-24 822/week @ 2024-10-01 417/week @ 2024-10-08 448/week @ 2024-10-15 626/week @ 2024-10-22 1202/week @ 2024-10-29 787/week @ 2024-11-05

3,168 downloads per month
Used in 49 crates (13 directly)

MIT/Apache

6KB
52 lines

oneshot-fused-workaround

Thin veneer over futures::channel::oneshot to fix use with futures::select!. See futures-rs ticket #2455.

License: MIT OR Apache-2.0


lib.rs:

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

Dependencies

~1MB
~15K SLoC