pub trait Alignment:
Sealed
+ Send
+ Sync
+ 'static
+ Copy
+ Clone {
const ALIGNMENT: Option<usize>;
const IS_ALIGNED: bool;
const ALIGN_BYTES: usize;
}Expand description
Trait representing a memory alignment guarantee.
Implemented by Zero-Sized Types (ZSTs) representing the alignment layout of the slice.
Required Associated Constants§
Sourceconst ALIGNMENT: Option<usize>
const ALIGNMENT: Option<usize>
The alignment boundary in bytes, if statically guaranteed.
Set to Some(N) for aligned views where N is a power of two, or None if
there is no static alignment guarantee (i.e. Unaligned).
Sourceconst IS_ALIGNED: bool
const IS_ALIGNED: bool
Whether static alignment is guaranteed.
Sourceconst ALIGN_BYTES: usize
const ALIGN_BYTES: usize
The alignment boundary in bytes (0 if unaligned).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".