[][src]Function safe_transmute::bool::safe_transmute_bool_pedantic

pub fn safe_transmute_bool_pedantic(bytes: &[u8]) -> Result<&[bool], Error>

View a byte slice as a slice of boolean values.

The byte slice must have at least enough bytes to fill a single bool.

Examples

assert_eq!(safe_transmute_bool_pedantic(&[0x01, 0x01, 0x01, 0x01])?,
           &[true, true, true, true]);
assert!(safe_transmute_bool_pedantic(&[]).is_err());