index-set 0.2.0

bitset implementation with support for atomic operations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use index_set::{BitSet, BitSetMut};


#[test]
fn test_bitvec() {
    let mut bitset: Vec<u32> = Vec::new();

    assert!(BitSetMut::insert(&mut bitset, 42).is_ok());
    assert!(BitSet::has(&bitset[..], 42));

    assert_eq!(BitSetMut::remove(&mut bitset, 42), Some(true));
    assert_eq!(BitSetMut::remove(&mut bitset, 0), Some(false));
}