-
Notifications
You must be signed in to change notification settings - Fork 201
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
Turn traits and execution model modules inside out #298
Conversation
r? @therealprof (rust-highfive has picked a reviewer for you, use r? to override) |
027e7d9
to
1d45750
Compare
Even though this change might be quite disruptive, I really like this approach. I imagine, normally when a user uses Sometimes, using mutliple implementations simulatiously could also happen. This change would make the use emedded_hal::{
nb::serial::Write,
blocking::serial::Write,
}; it would be like this: use emedded_hal::serial::{
nb::Write,
blocking::Write,
}; |
@ryankurte Are you aware of this proposal? Any concerns? Otherwise we'd go ahead merge it. |
thanks for the reminder, totally fell off the stack... it is an interesting exercise to consider alternative layouts and this change is neat that it creates an obvious space for common definitions, however, apart from that i'm not convinced there's a strong argument for this, or that the refactoring is a net improvement over the existing layout compared to say, adding a so i'm opposed to this as it seems to me to be substantial churn for predominantly a stylistic preference. while this is absolutely the time to make breaking changes, it does impact a bunch of downstream users, and i don't see that it makes anyone's e-h experience measurably or demonstrably better as justification for this.
my experience is probably the opposite of the comments on this PR. ime you tend to import a whole pile of peripheral definitions when wiring things up, what you use is primarily defined by the runtime available to you, and it's unlikely (*, except for there's also talk of feature-gating the upcoming |
Even if this PR is not accepted, there will still be a lot of churn due to #278. For the record, I do think that this refactor is a net improvement. |
I would say we shouldn't let "downstream churn" hold up progression of the crate design for Regarding the actual changeset: I also think this is a good idea because it improves discoverability. Some modules only exist in one of the two (three?) categories so it would be harder to see them if hidden behind an |
discovery is a fair point, though we also control the docs landing page / can put what we want on it / could steer people to the appropriate traits for their runtime. i am still not convinced it's an improvement but i also don't have any substantial concerns so, if the rest of @rust-embedded/hal are onboard don't let me stand in the way ^_^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryankurte Thanks for unblocking this.
I am a fan of the revised model for the reasons mentioned. So let's get the party started. 🎉
bors r+
A proposal for discussion.
Advantadges
Disadvantadges
embedded-hal
-dependent codeembedded_hal::xxx::blocking
modules, for example, although there is no much reason to do so.embedded_hal::xxx::nb
andembedded_hal::nb
.Open questions
blocking
/nb
submodules?Alternatives
Keep the structure as-is