the.bay.news

Are the `AsyncFn***` traits incomplete?

The Rust Programming Language Forum
Are the `AsyncFn***` traits incomplete?
The AsyncFn trait exists... That's pretty much all I can say about it. I had a few use-cases where I needed to accept a closure that returns a future, but every time, using impl AsyncFn (or equivalent) turns out to be more of an hassle than <F: Fn(..) -> Fut, Fut: Future<Output=T>>, because of Send Sync bounds, lifetime bounds and compiler errors that are very hard to parse involving seemingly internal associated types. So, is AsyncFn unusable as-is, or am I holding it wrong?

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.