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: usize
words: Vec<Word>
marker: PhantomData<T>
Implementations
Gets the domain size.
Creates a new, empty bitset with a given domain_size
.
Creates a new, filled bitset with a given domain_size
.
Clear excess bits in the final word.
Sets all bits to true.
Iterates over the indices of set bits in a sorted order.
Duplicates the set as a hybrid set.
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.
Sets self = self | other
and returns true
if self
changed
(i.e., if new bits were added).
Sets self = self - other
and returns true
if self
changed.
(i.e., if any bits were removed).
Sets self = self & other
and return true
if self
changed.
(i.e., if any bits were removed).
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for BitSet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for BitSet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes