pub trait ConstBitset {
const EMPTY: Self;
const BITS: Option<usize>;
}
pub trait BitsetDyn {
fn n_bits(&self) -> Option<usize>;
fn set(&mut self, bit: usize);
fn clear(&mut self, bit: usize);
fn test(&self, bit: usize) -> bool;
fn first_set(&self) -> Option<usize>;
fn next_set(&self, bit: usize) -> Option<usize>;
fn last_set(&self) -> Option<usize>;
fn is_empty(&self) -> bool;
fn count_ones(&self) -> usize;
fn invert_inplace(&mut self);
}
static_assertions::assert_obj_safe!(BitsetDyn);
pub trait BitsetStatic: BitsetDyn {
fn empty() -> Self;
fn with_bit(self, bit: usize) -> Self;
fn with_bits(self, bits: &[usize]) -> Self;
fn without_bit(self, bit: usize) -> Self;
fn without_bits(self, bits: &[usize]) -> Self;
fn intersection_top(&self, other: &Self) -> Option<usize>;
fn intersects(&self, other: &Self) -> bool;
fn union_inplace(&mut self, other: &Self);
fn intersect_inplace(&mut self, other: &Self);
fn bits(&self) -> impl Iterator<Item = usize>;
}