pub struct BitSet { /* private fields */ }Expand description
Bitset over dense node ids.
Implementations§
Source§impl BitSet
impl BitSet
Sourcepub fn insert(&mut self, id: DenseNodeId)
pub fn insert(&mut self, id: DenseNodeId)
Set bit.
Sourcepub fn remove(&mut self, id: DenseNodeId)
pub fn remove(&mut self, id: DenseNodeId)
Clear one bit.
Sourcepub fn contains(&self, id: DenseNodeId) -> bool
pub fn contains(&self, id: DenseNodeId) -> bool
Test bit.
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Number of set bits.
Sourcepub fn to_dense_ids(&self) -> Vec<DenseNodeId>
pub fn to_dense_ids(&self) -> Vec<DenseNodeId>
Collect set bit indices as dense node ids (ascending).
Sourcepub fn union_with(&mut self, other: &Self)
pub fn union_with(&mut self, other: &Self)
Union other into self (same length).
Sourcepub fn intersect_with(&mut self, other: &Self)
pub fn intersect_with(&mut self, other: &Self)
Intersect other into self (same length).
Sourcepub fn difference_with(&mut self, other: &Self)
pub fn difference_with(&mut self, other: &Self)
Subtract other from self (same length).
Sourcepub fn is_subset_of(&self, other: &Self) -> bool
pub fn is_subset_of(&self, other: &Self) -> bool
Whether self is a subset of other.
Trait Implementations§
impl Eq for BitSet
Auto Trait Implementations§
impl Freeze for BitSet
impl RefUnwindSafe for BitSet
impl Send for BitSet
impl Sync for BitSet
impl Unpin for BitSet
impl UnsafeUnpin for BitSet
impl UnwindSafe for BitSet
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