Enum rustc_index::bit_set::HybridBitSet [−][src]
pub enum HybridBitSet<T> {
Sparse(SparseBitSet<T>),
Dense(BitSet<T>),
}
Expand description
A fixed-size bitset type with a hybrid representation: sparse when there
are up to a SPARSE_MAX
elements in the set, but dense when there are more
than SPARSE_MAX
.
This type is especially efficient for sets that typically have a small
number of elements, but a large domain_size
, and are cleared frequently.
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.
Variants
Sparse(SparseBitSet<T>)
Tuple Fields of Sparse
0: SparseBitSet<T>
Dense(BitSet<T>)
Tuple Fields of Dense
0: BitSet<T>
Implementations
pub fn iter(&self) -> HybridIter<'_, T>ⓘNotable traits for HybridIter<'a, T>impl<'a, T: Idx> Iterator for HybridIter<'a, T> type Item = T;
impl<'a, T: Idx> Iterator for HybridIter<'a, T> type Item = T;
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 HybridBitSet<T> where
T: RefUnwindSafe,
impl<T> Send for HybridBitSet<T> where
T: Send,
impl<T> Sync for HybridBitSet<T> where
T: Sync,
impl<T> Unpin for HybridBitSet<T> where
T: Unpin,
impl<T> UnwindSafe for HybridBitSet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.