#bit-set #container #operation #uniset

no-std uniset

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

6 releases

new 0.3.0 May 20, 2025
0.2.4 Mar 13, 2024
0.2.3 Mar 22, 2023
0.2.1 Jan 2, 2023
0.1.1 Feb 18, 2020

#310 in Algorithms

Download history 1901/week @ 2025-01-29 2753/week @ 2025-02-05 1163/week @ 2025-02-12 2182/week @ 2025-02-19 1913/week @ 2025-02-26 2441/week @ 2025-03-05 2988/week @ 2025-03-12 1779/week @ 2025-03-19 1466/week @ 2025-03-26 1420/week @ 2025-04-02 1589/week @ 2025-04-09 2051/week @ 2025-04-16 2401/week @ 2025-04-23 1807/week @ 2025-04-30 1919/week @ 2025-05-07 1805/week @ 2025-05-14

8,356 downloads per month
Used in 4 crates (via unicycle)

MIT/Apache

55KB
943 lines

uniset

github crates.io docs.rs build status

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());

No runtime deps