#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

#2451 in Rust patterns

Download history 696/week @ 2024-12-25 795/week @ 2025-01-01 1086/week @ 2025-01-08 1311/week @ 2025-01-15 1323/week @ 2025-01-22 854/week @ 2025-01-29 2575/week @ 2025-02-05 1210/week @ 2025-02-12 881/week @ 2025-02-19 1108/week @ 2025-02-26 802/week @ 2025-03-05 1159/week @ 2025-03-12 793/week @ 2025-03-19 827/week @ 2025-03-26 773/week @ 2025-04-02 545/week @ 2025-04-09

3,129 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