Rust
General Notes
On the usage of impl Trait
impl Trait
is not intended as a replacement for dynamic dispatch (dyn Trait
).
It only allows you to write a placeholder for some types that are unrepresentable, like closures and iterators.
Embedded Rust
General Reminders
Implementing traits for all peripheral ‘kinds’ (as in peripherals that have the same function but different hardware implementations) eases migrating in the future from one implementation to the next and also allows you to implement virtual peripherals for testing without the real hardware.