abin 0.1.6

A library for working with binaries and strings. The library tries to avoid heap-allocations / memory-copy whenever possible by automatically choosing a reasonable strategy: stack for small binaries; static-lifetime-binary or reference-counting.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// This is just a placeholder for the payload of types. You only need this if you implement
/// your own type.
///
/// If you use your own bin data, make sure:
///  * The size must be exactly 3 words (3 * usize).
///  * The struct must be word-aligned (usize-aligned).
#[repr(C)]
#[derive(Clone, Copy)]
pub struct BinData(usize, usize, usize);

impl BinData {
    pub const fn empty() -> Self {
        Self(0, 0, 0)
    }
}