pub trait DmaDirection: Debug + Sealed {
const CAN_READ: bool;
const CAN_WRITE: bool;
}Expand description
Compile-time direction constraint for DMA buffers.
Implemented by three marker types:
DmaToDevice: write-only from the CPU perspectiveDmaFromDevice: read-only from the CPU perspectiveDmaBidirectional: full read/write
The associated constants are checked at compile time via
const { assert!(D::CAN_READ) } blocks, preventing e.g.
reading from a write-only buffer at zero runtime cost.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".