rust-embedded / embedded-dma

Apache License 2.0
35 stars 12 forks source link

Add Static versions for the traits #6

Closed thalesfragoso closed 3 years ago

thalesfragoso commented 3 years ago

This adds and recommends a new stricter variants of the unsafe traits. The new traits also carry an invariant of having a 'static lifetime, which is usually required in the most common DMA api because of mem::forget.

This is better than just adding a + 'static to the other traits because it still allows end users to unsafely bail out of the 'static lifetime if they know what they're doing.

CC @Dirbaio

thalesfragoso commented 3 years ago

Thanks for the review, code updated accordingly.

bors[bot] commented 3 years ago

Build succeeded:

eldruin commented 3 years ago

Ouch, I forgot about an entry in the changelog. @thalesfragoso could you open a new PR adding an entry to it for this addition?

thalesfragoso commented 3 years ago

@eldruin Yeah, a release would be nice, I will do the changelog PR now.

eldruin commented 3 years ago

@thalesfragoso Version 0.1.2 containing this is now published.