What is the right trait bound for an async closure? E.g. for async move |x| x * x How can I be generic over this? I've tried: where F: FnMut(I) -> Box<dyn Future<Output = T, E>> But that doesn't do what I expect; even if I add Box::new() in places.
-
Show this thread
-
(yes yes, I'm probably doing things I shouldn't. But it'll be really useful if I can get this to work!!)
1 reply 0 retweets 0 likesShow this thread -
Replying to @yoshuawuyts
How about something like this? https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=52c97f8eb6f0e1528f706b750d080c20 …
1 reply 1 retweet 3 likes
Replying to @stjepang
Ohhhh, awesome!!
10:20 AM - 12 Apr 2019
from Berlin, Germany
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.