const-sub-array
Allows to extract a fixed size sub-array out of an array with complie-time length and offset checks.
Based on sub-array
crate.
Example
Getting a sub array:
use SubArray;
let arr: = ;
// Get a sub-array starting at offset 1 with 3 items.
let sub: & = arr.;
assert_eq!;
Initializing an [u8; 10]
array with (u16, u32, u32)
:
use SubArray;
let foo: u16 = 42;
let bar: u32 = 0x1234;
let baz: u32 = 0x5678;
let mut arr = ;
*arr. = foo.to_be_bytes;
*arr. = bar.to_be_bytes;
*arr. = baz.to_be_bytes;
assert_eq!;
License: MIT