Named futures + replace NewConnection with Connection methods
Experimenting with a return to named 'static futures, motivated by downstream use cases. See e.g. https://github.com/hyperium/h3/pull/80.
Open questions:
- Which interfaces specifically need to be named?
- Is 'static needed, or just names?
- Are GATs + TAIT close enough that none of this matters?
Also included is an idea to drop NewConnection in favor of unobtrusive async methods on Connection, bundled because they would have to be rewritten to match this PR's approach if it move forwards. I'd like feedback on this change before I invest the effort to actually remove NewConnection and update all the examples/docs.
Sorry for the slow review...
No worries; it's not particularly pressing, nor a rebase hazard.
Still TODO: Actually getting rid of NewConnection, unless there's a compelling reason to keep it around.
That seems to have panned out to a pleasant simplification in the tests/examples. Less unwrap, less nesting, and fewer intermediate variables all 'round.