In 99.9% of the cases HALs should use the StaticXXBuffer traits. However, historically, many HAL implementors have gotten it wrong. Reasons:
The difference between them is not easy to understand.
The non-static traits look like the "default" choice due to the simpler name
The non-static traits look like a better choice due to the better ergonomics of use
Their original purpose was to allow using (unsafely) non-'static buffers with DMA functions.
However, the newer StaticXXBuffer make this possible. They don't have a : 'static bound, but are implemented for 'static buffers only. This allows users to (unsafely) "escape" the requirement by unsafe impling StaticXXBuffer for their types.
Therefore IMO having two sets of traits isn't worth the confusion it adds.
Proposal:
Remove ReadBuffer, WriteBuffer
Rename StaticReadBuffer, StaticWriteBuffer to ReadBuffer, WriteBuffer
Following up on conversations from Matrix.
In 99.9% of the cases HALs should use the
StaticXXBuffer
traits. However, historically, many HAL implementors have gotten it wrong. Reasons:Their original purpose was to allow using (unsafely) non-
'static
buffers with DMA functions. However, the newer StaticXXBuffer make this possible. They don't have a: 'static
bound, but are implemented for'static
buffers only. This allows users to (unsafely) "escape" the requirement byunsafe impl
ing StaticXXBuffer for their types.Therefore IMO having two sets of traits isn't worth the confusion it adds.
Proposal:
This is a breaking change of course.