async: User async-function-in-trait #77
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP attempt to use the recent async-function-in-trait feature. It makes embedded-nal-async regress into nightly-only, but then again the
feature(generic_associated_types)
was not even removed yet, and it's barely possible to actually implement the traits described here without using impl Trait in the associated types' definitions anyway.Benefits
Downsides
Connected
etc) had to go away due to known issues. But I kind of doubt we'd really have needed them.This probably needs further discussion, but before that I'll have to understand again myself why I had them there in the first place.
Status
This is experimentation at the moment, and only done for UDP (thus based on #73 until that is merged; only consider the top few commits for this PR). There is a branch on std-embedded-nal that already followed the switch. [edit: And because GitHub and GitLab don't federate PR mentions like modern issue trackers do: it's on https://gitlab.com/chrysn/std-embedded-nal/-/tree/async-fn-in-trait]
Porting DNS and TCP is a step on this PR's path from being a draft PR to a regular one.