bytemuck::internal

Function 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>().