pub struct GrowableBitSet<T: Idx> {
words: Vec<u64>,
marker: PhantomData<T>,
}Expand description
A resizable bitset type with a dense representation.
T is an index type, typically a newtyped usize wrapper, but it can also
just be usize.
Fields§
§words: Vec<u64>§marker: PhantomData<T>Implementations§
Source§impl<T: Idx> GrowableBitSet<T>
impl<T: Idx> GrowableBitSet<T>
Sourcefn ensure(&mut self, min_num_bits: usize)
fn ensure(&mut self, min_num_bits: usize)
Ensure that the set has allocated and initialized at least min_num_bits bits.
Sourcefn ensure_words(&mut self, min_num_words: usize)
fn ensure_words(&mut self, min_num_words: usize)
Ensures that the set has allocated and initialized at least min_num_words words.
pub fn new_empty() -> GrowableBitSet<T>
pub fn with_capacity(capacity: usize) -> GrowableBitSet<T>
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, elem: T) -> bool
pub fn iter(&self) -> BitIter<'_, T> ⓘ
Sourcepub fn union(&mut self, other: &GrowableBitSet<T>)
pub fn union(&mut self, other: &GrowableBitSet<T>)
Mutates self = self | other.
Trait Implementations§
Source§impl<T: Idx> Clone for GrowableBitSet<T>
impl<T: Idx> Clone for GrowableBitSet<T>
Source§impl<T: Idx> Default for GrowableBitSet<T>
impl<T: Idx> Default for GrowableBitSet<T>
impl<T: PartialEq + Idx> StructuralPartialEq for GrowableBitSet<T>
Auto Trait Implementations§
impl<T> Freeze for GrowableBitSet<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for GrowableBitSet<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for GrowableBitSet<T>where
PhantomData<T>: Send,
impl<T> Sync for GrowableBitSet<T>where
PhantomData<T>: Sync,
impl<T> Unpin for GrowableBitSet<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for GrowableBitSet<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for GrowableBitSet<T>where
PhantomData<T>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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: 24 bytes