Function lazy_bytes_cast::byte_slice_from
source · pub const fn byte_slice_from<T: Pod>(val: &T) -> &[u8]
Expand description
Gets byte slice out of the type.
Available only for types that marked as Pod
.
Usage
use lazy_bytes_cast::byte_slice_from;
static BYTES: &[u8] = byte_slice_from(&0u32);
Restrictions
Compilation fails for invalid type.
ⓘ
use lazy_bytes_cast::byte_slice_from;
static BYTES: &[u8] = byte_slice_from(&());