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
16
//! A `#[br(parse_with = …)]` field needs the inverse `#[bw(write_with = …)]` to be
//! encodable — a read-only custom codec can't round-trip.

use bnb::{BitError, Source, bin};

fn rd<S: Source>(_r: &mut S) -> Result<u8, BitError> {
    Ok(0)
}

#[bin(big)]
struct X {
    #[br(parse_with = rd)]
    v: u8,
}

fn main() {}