Function bytemuck::internal::try_pod_read_unaligned

source ·
pub(crate) unsafe fn try_pod_read_unaligned<T: Copy>(
    bytes: &[u8],
) -> Result<T, PodCastError>
Expand description

Reads from the bytes as if they were a T.

§Failure

  • If the bytes length is not equal to size_of::<T>().