Yabf
Just what the world needed - yet another bit field struct.
This is a small and simple implementation. It only has the basic functionality of a bit field:
- Set arbitary bit (if you set the millionth bit the list will use at least 125KB of heap space)
- Get bit value
- An iterator over the set bit indices. O(size of container)
- The container never shrinks.
yabf::Yabf is a std::vec::Vec
based bit field
let mut a = default;
let mut b = with_capacity;
a.set_bit;
b.set_bit;
assert!;
assert!;
assert!;
yabf::SmallYabf is a smallvec::SmallVec
based bit field. The struct will be entirely
stack allocated if it contains less than 129 bits.
let mut a = default;
let mut b = with_capacity;
a.set_bit;
b.set_bit;
assert!;
assert!;
assert!;
Rust cargo
yabf::SmallYabf is enabled by default, disable like this:
= {="^0.1.1",=false}
yabf::SmallYabf is enabled by default
= {="^0.1.1"}
License
Licensed under either of
at your option.