#bitset #const-generics #64-bit #words #size #parameters #numbers

no-std const_sized_bit_set

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

3 releases (breaking)

0.3.0 Dec 4, 2024
0.2.0 Dec 2, 2024
0.1.0 Mar 19, 2024

#706 in Data structures

Download history 2/week @ 2024-09-23 2/week @ 2024-10-14 3/week @ 2024-10-28 34/week @ 2024-11-04 2/week @ 2024-11-18 295/week @ 2024-12-02 27/week @ 2024-12-09

324 downloads per month

MIT license

99KB
2.5K 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 = BitSetArray::<2>::from_iter([0,1, 99].into_iter());

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

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

Dependencies

~160KB