dense_bitset

Crates.iodense_bitset
lib.rsdense_bitset
version0.1.1
sourcesrc
created_at2019-12-16 12:40:59.141742
updated_at2019-12-19 14:25:32.285879
descriptionA variably sized, heap allocated, dense bitset implemented using no `unsafe` code.
homepage
repositoryhttps://github.com/lcnr/dense_bitset
max_upload_size
id189745
size23,845
lcnr (lcnr)

documentation

README

Dense Bitset

A dense bitset implemented in rust using only safe code.

Examples

use dense_bitset::BitSet;

let mut set = BitSet::new();

set.insert(7);
set.set(4, true);
set.flip(5);

assert_eq!(set, [7, 4, 5].iter().collect());

set.remove(7);
set.flip(4);
set.set(5, false);

assert!(set.is_empty());

let a: BitSet = [2, 5, 12, 17].iter().collect();
let b: BitSet = [2, 12].iter().collect();

assert!(!a.is_disjoint(&b));
assert!(b.is_subset(&a));
assert!(a.is_superset(&b));
Commit count: 5

cargo fmt