Bitmatch
The bitmatch crate provides tools for packing and unpacking integers as
sequences of bits. Supports #![no_std]
.
Examples
Using #[bitmatch]
with a let
unpacks the bits into separate
single-character variables for each letter you use.
Using bitpack!()
re-packs the bits from those single-character variables
into a single integer.
use bitmatch;
You can use #[bitmatch]
on a match
as well, and it will ensure that the
literal portions match, and bind the variable portions.
use bitmatch;