Skip to main content

DmaDirection

Trait DmaDirection 

Source
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:

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§

Source

const CAN_READ: bool

Whether the CPU may read data transferred from the device.

Source

const CAN_WRITE: bool

Whether the CPU may write data to be transferred to the device.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§