RustcBitSet

Type Alias RustcBitSet 

Source
pub type RustcBitSet = MixedBitSet<usize>;
Expand description

A bitset specialized to usize indices.

Aliased Type§

pub enum RustcBitSet {
    Small(DenseBitSet<usize>),
    Large(ChunkedBitSet<usize>),
}

Variants§

Trait Implementations§

Source§

impl BitSet for RustcBitSet

Source§

fn empty(size: usize) -> Self

Constructs a new bit-set with a domain of size size.
Source§

fn contains(&self, index: usize) -> bool

Returns true if index is 1.
Source§

fn insert(&mut self, index: usize) -> bool

Sets index to 1, returning true if self changed.
Source§

fn remove(&mut self, index: usize) -> bool

Sets index to 0, returning true if self changed.
Source§

fn iter(&self) -> impl Iterator<Item = usize>

Returns an iterator over all the indices of ones in the bit-set.
Source§

fn intersect(&mut self, other: &Self)

Removes all ones in self not in other.
Source§

fn intersect_changed(&mut self, other: &Self) -> bool

Removes all ones in self not in other, returning true if self changed.
Source§

fn len(&self) -> usize

Returns the number of ones in the bit-set.
Source§

fn union(&mut self, other: &Self)

Adds all ones from other to self.
Source§

fn union_changed(&mut self, other: &Self) -> bool

Adds all ones from other to self, returning true if self changed.
Source§

fn subtract(&mut self, other: &Self)

Removes all ones from other in self.
Source§

fn subtract_changed(&mut self, other: &Self) -> bool

Removes all ones from other in self, returning true if self changed.
Source§

fn clear(&mut self)

Sets all bits to 0.
Source§

fn invert(&mut self)

Flips all bits in self.
Source§

fn insert_all(&mut self)

Adds every element of the domain to self.
Source§

fn copy_from(&mut self, other: &Self)

Copies other into self. Must have the same lengths.
Source§

fn is_empty(&self) -> bool

Returns true if there are no ones in the bit-set.
Source§

fn superset(&self, other: &Self) -> bool

Returns true if all ones in other are a one in self.