Function safe_transmute::guarded_transmute_bool_pedantic
source · Expand description
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!(guarded_transmute_bool_pedantic(&[0x01, 0x01, 0x01, 0x01])?,
&[true, true, true, true]);
assert!(guarded_transmute_bool_pedantic(&[]).is_err());