#alloc #align #alignment #no-std

no-std aligned-utils

Common utilities to work with aligned values and allocation

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

Download history 16/week @ 2024-07-22 24/week @ 2024-07-29 5/week @ 2024-08-05 38/week @ 2024-08-12 40/week @ 2024-08-19 91/week @ 2024-08-26 81/week @ 2024-09-02 15/week @ 2024-09-09 14/week @ 2024-09-23 9/week @ 2024-09-30 127/week @ 2024-10-07 91/week @ 2024-10-14 99/week @ 2024-10-21 88/week @ 2024-10-28 102/week @ 2024-11-04

393 downloads per month
Used in 2 crates

MIT license

14KB
308 lines

aligned-utils

Crates.io MIT licensed Docs CI

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;

No runtime deps

Features