#bitset #no-std #64-bit #const-generics #parameters #numbers #words

no-std const_sized_bit_set

A bitset with a const generic size parameter indicating the number of 64 bit words to use

1 unstable release

0.1.0 Mar 19, 2024

#13 in #64-bit

Download history 146/week @ 2024-03-15 25/week @ 2024-03-22 22/week @ 2024-03-29 10/week @ 2024-04-05 6/week @ 2024-04-12

72 downloads per month

MIT license

47KB
1K SLoC

Const Sized Bit Set

GITHUB

A bitset with a const generic size parameter indicating the number of 64 bit words to use. Can be used in no-std as it does not allocate.

Getting started

use const_sized_bit_set::*;

// This set has 2 64-bit words so this set can contain values in 0..=127
let mut set = BitSet::<2>::from_iter([0,1, 99].into_iter());

set.remove(1);
set.insert(100);

assert_eq!(set.to_string(), "[0, 99, 100]");

Dependencies

~185KB