rust_dense_bitset/
bitset.rs

1/// Trait to define the basic functions of a `BitSet`
2pub trait BitSet {
3    /// Sets the value of the bit at position `position` to `value`
4    fn set_bit(&mut self, position: usize, value: bool);
5
6    /// Gets the value of the bit at position `position`
7    fn get_bit(&self, position: usize) -> bool;
8
9    /// Returns the bitset's Hamming weight
10    fn get_weight(&self) -> u32;
11
12    /// Resets the bitset
13    fn reset(&mut self);
14
15    /// Produces a string representation of the bitset (little endian), aligned with 64 bits and with leading zeroes
16    fn to_string(self) -> String;
17}