O'Reilly logo
  • Ivan Zderadicka thinks this is interesting:

Thus, an advantage of this approach is that no allocation is necessary for returning the future.

From

Cover of Network Programming with Rust

Note

But also limitation should be mentioned - the returned type must be same for all possible return values from the function. It's one type, which will be concretized by compiler. Otherwise trait object must be used.