Function align_of

#[must_use]
pub const fn align_of<T>() -> usize

Returns the ABI-required minimum alignment of a type, in bytes.

Every reference to a value of the type T must be a multiple of this number.

This is the alignment used for struct fields. It may be smaller than the preferred alignment.

Examples

assert_eq!(4, align_of::<i32>());

(Caution: it is not guaranteed that the alignment of i32 is 4; that is, the above assertion does not pass on all platforms.)