Question: Is there no way to put statically defined named functions with all of them having the same signature in a collection type without using &dyn Fn or Box<dyn Fn>? My guess is no just want to make sure
Which would let you have `Vec<Box<dyn Fn(Args) -> Pin<Box<dyn Future<Output = Whatever>>>>>`
-
-
yea, but at that point you don't need to box the function anymore. You can just get a `fn(Args) -> Pin<Box<dyn Future<Output = Whatever>>>` for each element in the `Vec`
-
You're still using a closure closing over arguments of an unknown type, you can't turn that into a `fn` pointer in a useful way?
- 5 more replies
New conversation -
-
-
I hate this but what can I do :( If I don't I get this. Augh this API is starting to look disgusting I'll have to rethink this.pic.twitter.com/Nha9GqnIoe
-
You just need a cast I think? The type is inferred from the first function, and tries to use that ZST type instead of a function pointer type. So you cast to `fn(Args) -> Ret` to get an actual function pointer
End of conversation
New conversation -
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.