bitsandbytes 0.3.2

An owned, bit-aware binary codec: fast bit/byte field types and the unified #[bin] macro.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! `validate` runs in `build()`, so it needs the builder — it is incompatible with
//! `read_only` (and `no_builder`).
use bnb::bin;

#[bin(read_only, validate = check)]
struct Frame {
    a: bnb::u4,
    b: bnb::u4,
}

fn check(_: &Frame) -> Result<(), &'static str> {
    Ok(())
}

fn main() {}