A brief overview.
What we call "async fn in traits" is really multiple parts:
async fn
in traits + implsT: AsyncIter
but also "the future returned by next()
is Send
"dyn AsyncIter
and invoke async fn
methods-> impl Future
in the trait, though GATs + TAITs work too.And some auxiliary/optonal parts:
async fn
in trait but -> impl Future
in impl, or other more specific future types, in implCurrent status:
Part | Status |
---|---|
Core support | feature complete, but fixing bugs and writing tests |
Bounding | have a proposal to address this that needs to be better circulated, "return type notation" |
Dynamic dispatch | design space is enumerated, need to settle on a concrete design |
RPITIT | feature complete, but needs cleanup and also authoring of tests; GATs + TAITs will allow this to be written in "desugared form" |
Dynamic dispatch is a complex topic, but there are two main designs, and they come with their own dependencies:
Design | Dependencies |
---|---|
Decide alloc strategy at call site (part 9) | returning of unsized values |
Decide when creating dyn what adapter to use (part 8) | dyn* (started, needs elaboration) |