Expand description
Traits to aid the correct use of buffers in DMA abstractions.
This library provides the ReadBuffer and WriteBuffer unsafe traits to be used as bounds to
buffers types used in DMA operations.
There are some subtleties to the extent of the guarantees provided by these traits, all of these subtleties are properly documented in the safety requirements in this crate. However, as a measure of redundancy, some are listed below:
-
The traits only guarantee a stable location while no
&mut selfmethods are called uponSelf(with the exception ofwrite_bufferin our case). This is to allow types likeVec, this restriction doesn’t apply toSelf::Target. -
ReadBufferandWriteBufferguarantee a stable location for as long as the DMA transfer occurs. Given the intrinsics ofmem::forgetand the Rust language itself, a ’static lifetime is usually required.
The above list is not exhaustive, for a complete set of requirements and guarantees, the documentation of each trait and method should be analyzed.
Traits§
- Read
Buffer - Trait for buffers that can be given to DMA for reading.
- Read
Target - Trait for
Dereftargets used by the blanketDmaReadBufferimpl. - Word
- Trait for DMA word types used by the blanket DMA buffer impls.
- Write
Buffer - Trait for buffers that can be given to DMA for writing.
- Write
Target - Trait for
DerefMuttargets used by the blanketDmaWriteBufferimpl.