The documentation for the tokio-tungstenite crate mostly just directs you to the examples section.
The client example hasn't been updated in a few years and I saw some unfamiliar async code here and because Rust's async APIs are still in flux I wanted to check the use futures_util::future::select
was still idiomatic in this situation.
In particular, it seems to work fine if I replace it with the more commonly seen tokio::select!
macro, which doesn't require pinning the passed futures.
I have good familiarity with tokio's APIs but not so much the lower level futures
ones. Is there a reason to manually pin here and use the future::select
instead? More generally, in modern idiomatic async Rust code when would one use the latter?