Function safe_transmute::align::check_alignment_mut[][src]

pub fn check_alignment_mut<S, T>(
    data: &mut [S]
) -> Result<&mut [S], UnalignedError<'_, S, T>>

Check whether the given mutable data slice of Ss is properly aligned for reading and writing as a slice of Ts, returning the same slice back if it is.

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.