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
//! `#[bw(auto_len = <expr>)]` must be `count(<field>)` or `bytes(<field>)`.
use bnb::{WireLen, bin};

#[bin(big)]
struct Msg {
    #[bw(auto_len = size(items))]
    n: WireLen<u16>,
    #[br(count = n.to_count())]
    items: Vec<u8>,
}

fn main() {}