#alloc #align #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

#1220 in Data structures

Download history 58/week @ 2023-11-20 89/week @ 2023-11-27 104/week @ 2023-12-04 117/week @ 2023-12-11 56/week @ 2023-12-18 121/week @ 2023-12-25 96/week @ 2024-01-01 171/week @ 2024-01-08 102/week @ 2024-01-15 89/week @ 2024-01-22 131/week @ 2024-01-29 24/week @ 2024-02-05 52/week @ 2024-02-12 146/week @ 2024-02-19 175/week @ 2024-02-26 128/week @ 2024-03-04

505 downloads per month
Used in carapace

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