The original async/await RFC specifies await (well, the macro variant) to go through a IntoFuture trait (see RFC).
Is there a reason why this wasn't implemented, or is this an oversight?
The context is a blog post which gave me the idea for an IntoFuture trait, but someone pointed out that it actually was already in the RFC.
It was removed at some point, but before I got involved; I believe @boats or @Taylor Cramer could expand.
We found in futures 0.2 that it was not needed. In 0.1, when future incorporated the error into its type, Result implemented
IntoFuture, but in 0.2, there was nothing that did other than futures
(nit: futures and tuples)
but yeah, @boats's summary is correct
there was nothing that did other than futures
The blog post outlines the use case where I also personally would have wanted this numerous times: being able to
.await on a builder type structs, like http/db request builders.
Without this it requires either always calling a finalizer method like
.send(), or keeping an
Option<MyFuture> on the builder and checking it on every poll.
IntoFuture would be a pretty big ergonomics win.