pub struct BitVec<T> { /* private fields */ }Expand description
A growable bit-vector type with a dense representation.
T is an index type, typically a newtyped usize wrapper, but it can also
just be usize.
Implementations§
source§impl<T: Idx> BitVec<T>
impl<T: Idx> BitVec<T>
sourcepub fn with_capacity(capacity: usize) -> BitVec<T>
pub fn with_capacity(capacity: usize) -> BitVec<T>
Creates a new, empty bitvec with a given capacity.
sourcepub fn ensure(&mut self, capacity: usize)
pub fn ensure(&mut self, capacity: usize)
Ensure that the set can hold at least capacity elements.
sourcepub fn insert_all(&mut self)
pub fn insert_all(&mut self)
Sets all bits to true.
sourcepub fn iter(&self) -> BitIter<'_, T> ⓘ
pub fn iter(&self) -> BitIter<'_, T> ⓘ
Iterates over the indices of set bits in a sorted order.
pub fn union(&mut self, other: &BitVec<T>) -> bool
pub fn subtract(&mut self, other: &BitVec<T>) -> bool
pub fn intersect(&mut self, other: &BitVec<T>) -> bool
Trait Implementations§
source§impl<T: PartialEq> PartialEq for BitVec<T>
impl<T: PartialEq> PartialEq for BitVec<T>
impl<T: Eq> Eq for BitVec<T>
impl<T> StructuralPartialEq for BitVec<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for BitVec<T>where
T: RefUnwindSafe,
impl<T> Send for BitVec<T>where
T: Send,
impl<T> Sync for BitVec<T>where
T: Sync,
impl<T> Unpin for BitVec<T>where
T: Unpin,
impl<T> UnwindSafe for BitVec<T>where
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.