4 releases (stable)
1.0.2 | Feb 27, 2021 |
---|---|
1.0.1 | Jan 28, 2021 |
1.0.0 | Jan 12, 2021 |
0.2.0 | Dec 31, 2020 |
#2167 in Data structures
393 downloads per month
Used in 2 crates
14KB
308 lines
aligned-utils
Common utilities to work with aligned values and allocation.
Example
use aligned_utils::stack::Align8;
let mut arr = Align8([1, 2, 3]);
let bytes: &[u8] = &*arr;
use aligned_utils::bytes::AlignedBytes; // with feature "alloc"
let mut bytes = AlignedBytes::new_zeroed(1024, 8);
let buf: &mut [u8] = &mut *bytes;
lib.rs
:
Common utilities to work with aligned values and allocation.
Example
use aligned_utils::stack::Align8;
let mut arr = Align8([1, 2, 3]);
let bytes: &[u8] = &*arr;
use aligned_utils::bytes::AlignedBytes; // with feature "alloc"
let mut bytes = AlignedBytes::new_zeroed(1024, 8);
let buf: &mut [u8] = &mut *bytes;