uniset

Crates.iouniset
lib.rsuniset
version0.3.0
created_at2020-02-18 12:08:12.242678+00
updated_at2025-05-20 12:15:51.649705+00
descriptionA hierarchical, growable bit set with support for in-place atomic operations.
homepagehttps://github.com/udoprog/uniset
repositoryhttps://github.com/udoprog/uniset
max_upload_size
id210285
size95,449
John-John Tedro (udoprog)

documentation

https://docs.rs/uniset

README

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());
Commit count: 46

cargo fmt