Function object::pod::slice_from_all_bytes

source ยท
pub fn slice_from_all_bytes<T: Pod>(data: &[u8]) -> Result<&[T], ()>
Expand description

Cast all of a byte slice to a slice of a Pod type.

Returns the type slice.

Returns an error if the size of the byte slice is not an exact multiple of the type size, or the alignment is invalid.