pub struct BitSet<T> { /* private fields */ }
Expand description
A fixed-size bitset type with a dense representation.
NOTE: Use GrowableBitSet
if you need support for resizing after creation.
T
is an index type, typically a newtyped usize
wrapper, but it can also
just be usize
.
All operations that involve an element will panic if the element is equal to or greater than the domain size. All operations that involve two bitsets will panic if the bitsets have differing domain sizes.
Trait Implementations§
source§impl BitSet for BitSet<usize>
impl BitSet for BitSet<usize>
source§fn iter(&self) -> Self::Iter<'_>
fn iter(&self) -> Self::Iter<'_>
Returns an iterator over all the indices of ones in the bit-set.
source§fn 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.source§fn 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.source§fn 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.source§fn insert_all(&mut self)
fn insert_all(&mut self)
Adds every element of the domain to
self
.Auto Trait Implementations§
impl<T> RefUnwindSafe for BitSet<T>where
T: RefUnwindSafe,
impl<T> Send for BitSet<T>where
T: Send,
impl<T> Sync for BitSet<T>where
T: Sync,
impl<T> Unpin for BitSet<T>where
T: Unpin,
impl<T> UnwindSafe for BitSet<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more