rust-embedded-community / embedded-nal

An Embedded Network Abstraction Layer
Apache License 2.0
177 stars 25 forks source link

async: User async-function-in-trait #77

Closed chrysn closed 1 year ago

chrysn commented 1 year ago

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

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.

chrysn commented 1 year ago

Closing this because it's all being included in #73.

The "it's nightly again" and "TCP/DNS is missing" are moot since #78.

I've looked at the Connected (etc) lifetimes, and think that the old lifetimes were just a needless artifact -- so I see no open discussion points worth carrying over to #73.