Trait BitSetLike
trait BitSetLike: Clone + fmt::Debug
Trait for types which can be handled with BitSetStrategy.
Required Methods
fn new_bitset(max: usize) -> SelfCreate a new value of
Selfwith space for up tomaxbits, all initialised to zero.fn len(self: &Self) -> usizeReturn an upper bound on the greatest bit set plus one.
fn test(self: &Self, ix: usize) -> boolTest whether the given bit is set.
fn set(self: &mut Self, ix: usize)Set the given bit.
fn clear(self: &mut Self, ix: usize)Clear the given bit.
Provided Methods
fn count(self: &Self) -> usizeReturn the number of bits set.
This has a default for backwards compatibility, which simply does a linear scan through the bits. Implementations are strongly encouraged to override this.
Implementors
impl BitSetLike for i16impl BitSetLike for u32impl BitSetLike for crate::std_facade::Vec<bool>impl BitSetLike for i32impl BitSetLike for u64impl BitSetLike for i64impl BitSetLike for usizeimpl BitSetLike for u8impl BitSetLike for isizeimpl BitSetLike for VarBitSetimpl BitSetLike for i8impl BitSetLike for u16impl BitSetLike for bit_set::BitSet