[][src]Function safe_transmute::guarded_transmute_pod_many_permissive

pub fn guarded_transmute_pod_many_permissive<T: PodTransmutable>(
    bytes: &[u8]
) -> Result<&[T], Error>

View a byte slice as a slice of a POD type.

The resulting slice will have as many instances of a type as will fit, rounded down.

Errors

An error is raised in one of the following situations:

Examples

assert_eq!(guarded_transmute_pod_many_permissive::<u16>(&[0x00]), Ok([].as_ref()));