bittle
A library for working with small and cheap bit sets and masks.
The name bittle
comes from bit
and little
.
The bit sets are entirely defined using Copy types in Rust such as u64
or [u128; 4]
who's number of bits define the capacity of the set.
use FixedSet;
use mem;
let mut set = empty;
assert!;
set.set;
assert!;
set.unset;
assert!;
assert_eq!;
The Mask trait can be used to abstract over the read-only side of a bit set. It has useful utilities such as iterating over masked elements through Mask::join.
use ;
let elements = vec!;
let mut m = empty;
// Since set is empty, no elements are iterated over.
let mut it = m.join;
assert_eq!;
m.set;
let mut it = m.join;
assert_eq!;
assert_eq!;
Examples
License: MIT/Apache-2.0