Why do we not have a way to refer to the future type of an async function?

52 points Giocri 34 comments

I am writing a relatively simple library that has to deal with async io operation, the issue that triggers this titile is that one of my dependency exposes an async function and that's the one single type of future i have to deal with and i wanted to store and pool them manually but apparently there is absolutely no way to do so without boxing for type erasure.

So tldr i have a vector of concrete objects with a knowable type that i have to box and use dynamic dyspatch on for no other reason than being inable to name that type when creating declaring my vec