Function dataview::bytes

source ·
pub fn bytes<T: ?Sized + Pod>(src: &T) -> &[u8]
Expand description

Returns the object’s memory as a byte slice.

let v = 0xcdcdcdcd_u32;
assert_eq!(dataview::bytes(&v), &[0xcd, 0xcd, 0xcd, 0xcd]);