1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
[]
= "bitsandbytes"
= "0.1.0"
= true
= true
= true
= true
= "An owned, bit-aware binary codec: fast bit/byte field types and the unified #[bin] macro."
= "README.md"
[]
# Published as `bitsandbytes`, but the library is named `bnb` — so the crate's own
# tests/doctests/examples and downstream `bnb = { package = "bitsandbytes" }`
# consumers all import it as `bnb`.
= "bnb"
[]
# The derive/attribute macros live in a sibling proc-macro crate (a proc-macro
# crate cannot also export runtime items). Re-exported below so users only
# depend on `bnb`.
= { = true }
# Structured diagnostics: the `#[br(dbg)]` directive emits a `tracing` event (TRACE,
# target `bnb::dbg`). Optional, pulled in by the `std` feature — `tracing`'s default
# features link `std`, and the workspace dep can't be overridden here, so `#[br(dbg)]`
# is a `std`-only debugging aid (an embedded build uses its own logger).
= { = true, = true }
# Optional: zero-copy `Source`/`Sink` over the `bytes` crate (own a `Bytes` frame to
# decode, encode to a `Bytes` to send) — for async/tokio framing. Off by default so
# the core stays dependency-light; users off tokio never pull it in. The adapters are
# inherently a std/tokio concern, so the `bytes` feature also turns on `std`.
= { = true, = true }
[]
# `std` (default) enables the `std::io` ladder (`StreamBitReader`/`BufSource`/
# `SeekReader`, `encode(writer)`/`spec_encode(writer)`, `From<std::io::Error>`) and the
# `tracing`-backed `#[br(dbg)]` directive. Without it `bnb` is `no_std` — it always
# needs `alloc`: decode from `&[u8]`, encode to `Vec<u8>`.
= ["std"]
= ["dep:tracing"]
# `bytes`-crate adapters (`BytesReader`/`BytesWriter`); imply `std` (tokio framing).
= ["dep:bytes", "std"]
[]
# Compile-fail UI tests: assert that `#[bin]`/`#[bitfield]` misuse is rejected with
# a clear, well-spanned error. Regenerate snapshots with `TRYBUILD=overwrite`.
= true
# Property-based round-trip stress testing.
= true
# Statistical benchmarking with HTML reports. The benches use `Criterion::default()`
# directly (no shared `testutil` harness) so `bnb` stays self-contained / publishable.
= { = true, = ["html_reports"] }
# The crates `bnb` replaces — used *only* in benchmarks to substantiate the
# "as fast as a hand-written shift/mask" claim before any migration. They are
# dev-dependencies, so they never enter a real build.
= true
= true
= true
[[]]
= "bitfield_bench"
= false
[[]]
= "bitstream_bench"
= false
[]
= true