`AsyncFn*` are still almost unusable. Any news on improving them?
⚓ Rust 📅 2026-01-14 👤 surdeus 👁️ 2I'ts been quite some time after AsyncFn* traits were introduced. Yet, they still have very limited use. The main issue, as many know, is that you can't access hidden future type in stable code to apply some constraints onto it. As a result, any real server code which requires futures to be Send, literally unable to use them. Meanwhile, Fn*(..) -> impl Future<..> + Send has very limited usage too because you can't bound it by initial function's self. Language feature which would allow constraining function's return type directly seems to be nowhere on the horizon too.
So, can anyone please point onto some modern approaches to this issue without custom traits and kilometers of workarounds?
Thanks
1 post - 1 participant
🏷️ Rust_feed