natbitset
A super-lightweight bitset implementation for positive integers.
Quickstart
use *;
// Construct a bitset:
let bitset = from;
// Retrieve the integers present in the set:
bitset.members;
// => HashSet {1,2,3}
// Get the underlying bit representation:
*bitset;
// => 0b_0000_0111
// Add an element:
bitset += 4;
// => Bitset(0b_0000_1111)
// Union with another set:
bitset |= from;
// => Bitset(0b_0011_1111)
// Intersect with another set:
bitset &= from;
// => Bitset(0b_0000_0101)
For more detailed guidance on how to use the struct, as well as an explanation of how it works, please visit the documentation on docs.rs!