pub trait BitSet: Clone + PartialEq {
type Iter<'a>: Iterator<Item = usize>
where Self: 'a;
Show 17 methods
// Required methods
fn empty(size: usize) -> Self;
fn insert(&mut self, index: usize) -> bool;
fn contains(&self, index: usize) -> bool;
fn iter(&self) -> Self::Iter<'_>;
fn len(&self) -> usize;
fn union(&mut self, other: &Self);
fn intersect(&mut self, other: &Self);
fn subtract(&mut self, other: &Self);
fn invert(&mut self);
fn clear(&mut self);
fn insert_all(&mut self);
fn copy_from(&mut self, other: &Self);
// Provided methods
fn is_empty(&self) -> bool { ... }
fn union_changed(&mut self, other: &Self) -> bool { ... }
fn intersect_changed(&mut self, other: &Self) -> bool { ... }
fn subtract_changed(&mut self, other: &Self) -> bool { ... }
fn superset(&self, other: &Self) -> bool { ... }
}
Expand description
Interface for bit-set implementations.
Implement this trait if you want to provide a custom bit-set beneath the indexical abstractions.
Required Associated Types§
Required Methods§
sourcefn iter(&self) -> Self::Iter<'_>
fn iter(&self) -> Self::Iter<'_>
Returns an iterator over all the indices of ones in the bit-set.
sourcefn insert_all(&mut self)
fn insert_all(&mut self)
Adds every element of the domain to self
.
Provided Methods§
sourcefn union_changed(&mut self, other: &Self) -> bool
fn union_changed(&mut self, other: &Self) -> bool
Adds all ones from other
to self
, returning true if self
changed.
sourcefn intersect_changed(&mut self, other: &Self) -> bool
fn intersect_changed(&mut self, other: &Self) -> bool
Removes all ones in self
not in other
, returning true if self
changed.
sourcefn subtract_changed(&mut self, other: &Self) -> bool
fn subtract_changed(&mut self, other: &Self) -> bool
Removes all ones from other
in self
, returning true if self
changed.
Object Safety§
This trait is not object safe.
Implementors§
source§impl BitSet for RoaringSet
Available on crate feature roaring
only.
impl BitSet for RoaringSet
Available on crate feature
roaring
only.source§impl<T: SimdSetElement, const N: usize> BitSet for SimdBitset<T, N>where
LaneCount<N>: SupportedLaneCount,
Simd<T, N>: for<'a> BitOr<&'a Simd<T, N>, Output = Simd<T, N>>,
Simd<T, N>: for<'a> BitAnd<&'a Simd<T, N>, Output = Simd<T, N>>,
Available on crate feature simd
only.
impl<T: SimdSetElement, const N: usize> BitSet for SimdBitset<T, N>where LaneCount<N>: SupportedLaneCount, Simd<T, N>: for<'a> BitOr<&'a Simd<T, N>, Output = Simd<T, N>>, Simd<T, N>: for<'a> BitAnd<&'a Simd<T, N>, Output = Simd<T, N>>,
Available on crate feature
simd
only.