pub unsafe fn guarded_transmute_many_permissive<T>(bytes: &[u8]) -> &[T]Notable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Expand description

View a byte slice as a slice of an arbitrary type.

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

Examples

assert_eq!(guarded_transmute_many_permissive::<u16>(&[0x00]), &[]);