Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite tait's -> async fn | mem::replace-> take() #50

Closed
wants to merge 2 commits into from

Conversation

Vollbrecht
Copy link

implements #49

@MabezDev
Copy link
Member

It's clear to me that TAIT will be stabilized before AFIT, and this seems even more apparent given that they are splitting the feature and pushing the stabilization of impl Trait in assoc types (our usecase). With embedded-io moving to AFIT quite early, it puts us in a bit of a tricky spot.

I guess to support both we need to make embedded-io 0.3 and 0.4 optional, which either can be opted in to. The problem is that using embedded-io we're locked into their choices, maybe we should petition in upstream embedded-io to switch back to TAIT (downside: more ecosystem churn).

Not sure what the best solution is here.

@Vollbrecht
Copy link
Author

next embedded-hal wg meeting is not announced yet? adamgreig mention he is away till 2nd May

@ivmarkov
Copy link
Collaborator

I've implemented a different approach for now, which is heavier weight on embedded-svc but minimizes any other changes elsewhere - basically, rather than pub use-ing the async traits of embedded-io from within embedded-svc::io, I've moved them into embedded-svc::io, yet I've raised the dependency on embedded-io 0.4, as the rest of that crate can be re-used unchanged (the blocking and the common parts). There's also EmbIo adapter if somebody really really needs to pass an embedded-io-4 async trait impl where we have embedded_svc::io::asynch impl or the other way around. Not that I expect such a use-case to happen, but you never know.

@ivmarkov
Copy link
Collaborator

We can keep this PR open and push it (potentially - with changes) once there is extra clarity how the "real" async traits are going to look like (not the TAIT + GAT manual desugaring we are continuing to use for now). I'm however not holding my breath that async traits are going to land any time soon.

@Vollbrecht
Copy link
Author

@ivmarkov
Copy link
Collaborator

ivmarkov commented Sep 2, 2023

Unfortunately TAIT was not stabilized, and in the meantime AFIT is not incomplete.
The rest of the embedded community is heavily leaning on AFIT, as we are switching too - here: #56

@ivmarkov ivmarkov closed this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants