Function check_alignment

Source
pub fn check_alignment<S, T>(data: &[S]) -> Result<(), UnalignedError<'_, S, T>>
Expand description

Check whether the given data slice of Ss is properly aligned for reading and writing as a slice of Ts.

ยงErrors

An Error::Unaligned error is returned with the number of bytes to discard from the front in order to make the conversion safe from alignment concerns.