pub unsafe trait StagingPod: Copy { }Expand description
Types for which every bit pattern is a valid value.
StagingBuffer hands out &mut [T] / &[T] views over page-locked bytes
that were either zero-filled at allocation time or last written by a DMA
from the device. Materialising such a view is only sound when no bit pattern
those bytes could hold is invalid for T — which rules out types with
niches (bool, char, NonZeroU32, enums, references) even though they
are Copy.
§Safety
Implementors must guarantee that T has no invalid bit patterns, no padding
whose contents could be observed as uninitialised, and no interior
pointers/references that would be meaningless after a device round trip.
Numeric primitives and #[repr(transparent)] wrappers over them qualify.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl StagingPod for bf16
half only.impl StagingPod for f16
half only.