Skip to content
/ uniset Public

A hierarchical growable bitset which supports in-place atomic operations

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

udoprog/uniset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.


Features

  • vec-safety - Avoid relying on the assumption that &mut Vec<T> can be safely coerced to &mut Vec<U> if T and U have an identical memory layouts (enabled by default, issue #1).

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

About

A hierarchical growable bitset which supports in-place atomic operations

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages