I have noticed that map for the future returns Map object, the similar stuff is going on for and_then, and other combinators. As a result of long chain of futures you end up with something like this:
And this is only 2 combinator functions applied in the chain. I understand that it is Intelij specific, but I find these type hints very-very helpful, and decoding the type of a variable without these hints would be even more problematic.
However, my brain is too much overloaded when I need to know what Map, AndThen and so on mean and what they also implement, etc… And all of this is only for knowing that
full_body is really of a type equivalent to
Why do I need to know that map returns
Map<...> but not Future<Result, Error>? Is it because returning the Box requires an allocation?
impl Future feature fix it?
Or alternatively, would not it be better to design all future combinators to return
Box<Future<...>> instead and have preallocated, expandable memory pool for frequent operations with boxed futures?