`AsyncFn*` are still almost unusable. Any news on improving them?

I'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

I asked a question earlier and from the reply, it looks like AsyncFn* are not that useful.

Use the async trait crate and call it a day. Once the async traits functionality provided by the language is on par with the features provided by the crate, you can simply remove the dependency.

2 Likes