pub trait BitSet: Clone + PartialEq {
fn empty(size: usize) -> Self;
fn insert(&mut self, index: usize) -> bool;
fn remove(&mut self, index: usize) -> bool;
fn contains(&self, index: usize) -> bool;
fn iter(&self) -> impl Iterator<Item = usize>;
fn len(&self) -> usize;
fn is_empty(&self) -> bool {
self.len() == 0
}
fn union(&mut self, other: &Self);
fn union_changed(&mut self, other: &Self) -> bool {
let n = self.len();
self.union(other);
n != self.len()
}
fn intersect(&mut self, other: &Self);
fn intersect_changed(&mut self, other: &Self) -> bool {
let n = self.len();
self.intersect(other);
n != self.len()
}
fn subtract(&mut self, other: &Self);
fn subtract_changed(&mut self, other: &Self) -> bool {
let n = self.len();
self.intersect(other);
n != self.len()
}
fn invert(&mut self);
fn clear(&mut self);
fn insert_all(&mut self);
fn superset(&self, other: &Self) -> bool {
let orig_len = self.len();
let mut self_copy = self.clone();
self_copy.union(other);
orig_len == self_copy.len()
}
fn copy_from(&mut self, other: &Self);
}
#[cfg(feature = "bitvec")]
pub mod bitvec;
#[cfg(feature = "rustc")]
pub mod rustc;
#[cfg(feature = "simd")]
pub mod simd;
#[cfg(feature = "roaring")]
pub mod roaring;