align_data

Macro include_transmute

Source
macro_rules! include_transmute {
    ($file:expr) => { ... };
}
Expand description

Transmutes the included bytes.

This macro ensures that the resulting instance is aligned properly.

§Examples

use align_data::include_transmute;

static DATA: [u32; 3] = unsafe { include_transmute!("../tests/data.txt") };
assert_eq!(DATA[0], u32::from_ne_bytes([b'A'; 4]));

§Safety

This macro simply transmutes the included byte array to its destination type. It is your responsibility to ensure that this transmutation is correct.