Struct rustc_index::bit_set::BitSet [−][src]
pub struct BitSet<T> {
domain_size: usize,
words: Vec<Word>,
marker: PhantomData<T>,
}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.
Fields
domain_size: usizewords: Vec<Word>marker: PhantomData<T>Implementations
impl<T> BitSet<T>[src]
impl<T> BitSet<T>[src]pub fn domain_size(&self) -> usize[src]
pub fn domain_size(&self) -> usize[src]Gets the domain size.
impl<T: Idx> BitSet<T>[src]
impl<T: Idx> BitSet<T>[src]pub fn new_empty(domain_size: usize) -> BitSet<T>[src]
pub fn new_empty(domain_size: usize) -> BitSet<T>[src]Creates a new, empty bitset with a given domain_size.
pub fn new_filled(domain_size: usize) -> BitSet<T>[src]
pub fn new_filled(domain_size: usize) -> BitSet<T>[src]Creates a new, filled bitset with a given domain_size.
fn clear_excess_bits(&mut self)[src]
fn clear_excess_bits(&mut self)[src]Clear excess bits in the final word.
pub fn insert_all(&mut self)[src]
pub fn insert_all(&mut self)[src]Sets all bits to true.
pub fn union(&mut self, other: &impl UnionIntoBitSet<T>) -> bool[src]
pub fn union(&mut self, other: &impl UnionIntoBitSet<T>) -> bool[src]Sets self = self | other and returns true if self changed
(i.e., if new bits were added).
pub fn subtract(&mut self, other: &impl SubtractFromBitSet<T>) -> bool[src]
pub fn subtract(&mut self, other: &impl SubtractFromBitSet<T>) -> bool[src]Sets self = self - other and returns true if self changed.
(i.e., if any bits were removed).
pub fn intersect(&mut self, other: &BitSet<T>) -> bool[src]
pub fn intersect(&mut self, other: &BitSet<T>) -> bool[src]Sets self = self & other and return true if self changed.
(i.e., if any bits were removed).
pub fn to_hybrid(&self) -> HybridBitSet<T>[src]
pub fn to_hybrid(&self) -> HybridBitSet<T>[src]Duplicates the set as a hybrid set.
fn reverse_union_sparse(&mut self, sparse: &SparseBitSet<T>) -> bool[src]
fn reverse_union_sparse(&mut self, sparse: &SparseBitSet<T>) -> bool[src]Set self = self | other. In contrast to union returns true if the set contains at
least one bit that is not in other (i.e. other is not a superset of self).
This is an optimization for union of a hybrid bitset.
Trait Implementations
impl<T: Idx> SubtractFromBitSet<T> for BitSet<T>[src]
impl<T: Idx> SubtractFromBitSet<T> for BitSet<T>[src]fn subtract_from(&self, other: &mut BitSet<T>) -> bool[src]
impl<T: Idx> UnionIntoBitSet<T> for BitSet<T>[src]
impl<T: Idx> UnionIntoBitSet<T> for BitSet<T>[src]fn union_into(&self, other: &mut BitSet<T>) -> bool[src]
impl<T: Eq> Eq for BitSet<T>[src]
impl<T> StructuralEq for BitSet<T>[src]
impl<T> StructuralPartialEq for BitSet<T>[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BitSet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BitSet<T> where
T: Send,
T: Send,
impl<T> Sync for BitSet<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BitSet<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BitSet<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more