This crate is deprecated
This crate can be replaced with vob if you add this trait to your code:
// u32 is slightly faster for random access w/o any bit operations
pub type VobU32 = Vob;
pub
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 arbitrary 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;
// bits are false by default
assert_eq!;
a.set_bit;
assert_eq!;
b.set_bit;
assert_eq!;
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_eq!;
assert_eq!;
assert_eq!;
Rust cargo
yabf::SmallYabf is enabled by default, disable like this:
= {="0.3",=false}
yabf::SmallYabf is enabled by default
= {="0.3"}
License
Licensed under either of
at your option.