[go: up one dir, main page]

uniset 0.3.0

A hierarchical, growable bit set with support for in-place atomic operations.
Documentation

uniset

A hierarchical, growable bit set with support for in-place atomic operations.

The idea is based on hibitset, but dynamically growing instead of having a fixed capacity. By being careful with the underlying data layout, we also support structural sharing between the local and atomic bitsets.

Examples

use uniset::BitSet;

let mut set = BitSet::new();
assert!(set.is_empty());
assert_eq!(0, set.capacity());

set.set(127);
set.set(128);
assert!(!set.is_empty());

assert!(set.test(128));
assert_eq!(vec![127, 128], set.iter().collect::<Vec<_>>());
assert!(!set.is_empty());

assert_eq!(vec![127, 128], set.drain().collect::<Vec<_>>());
assert!(set.is_empty());