#tor #oneshot #workaround #tor-arti

oneshot-fused-workaround

Fused wrapper for futures::channel::oneshot

3 unstable releases

0.2.1 Jan 7, 2025
0.2.0 Sep 30, 2024
0.1.0 Sep 3, 2024

#2448 in Rust patterns

Download history 712/week @ 2024-12-23 663/week @ 2024-12-30 1212/week @ 2025-01-06 1174/week @ 2025-01-13 1130/week @ 2025-01-20 1215/week @ 2025-01-27 2151/week @ 2025-02-03 1459/week @ 2025-02-10 1094/week @ 2025-02-17 978/week @ 2025-02-24 987/week @ 2025-03-03 1034/week @ 2025-03-10 831/week @ 2025-03-17 748/week @ 2025-03-24 927/week @ 2025-03-31 628/week @ 2025-04-07

3,210 downloads per month
Used in 54 crates (13 directly)

MIT/Apache

6KB
54 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

~0.6–0.8MB
~15K SLoC