include-bytes-plus
Improved version of Rust's include_bytes
macro that allows to reinterpret input as differently typed array.
Due to inability to capture current file path in the stable Rust, this macro only accepts paths relative to crate's root.
Supported types:
-
Primitive fixed sized unsigned integers with optional endianness suffix;
-
Arrays with unsigned integers;
Usage:
use include_bytes;
let bytes = include_bytes!;
let bytes_u16 = include_bytes!;
let bytes_u16_2 = include_bytes!;
let bytes_u16_3 = include_bytes!;
let bytes_u16_4 = include_bytes!;
let bytes_u16be = include_bytes!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Debugging timings:
Set env variable RUST_INCLUDE_BYTES_LOG=1
to enable logging of each parsed file statistics