Function constmuck::bytes_of

source ·
pub const fn bytes_of<T>(bytes: &T) -> &[u8]
where T: NoUninit,
Expand description

Casts &T to &[u8]

Example

use constmuck::bytes_of;

const BYTES: &[u8] = bytes_of(&987654321u32);

assert_eq!(*BYTES, 987654321u32.to_ne_bytes());