pub struct GrowableBitSet<T>where
T: Idx,{ /* private fields */ }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.
All operations that involve an element will panic if the element is equal to or greater than the domain size.
Implementations§
Source§impl<T> GrowableBitSet<T>where
T: Idx,
impl<T> GrowableBitSet<T>where
T: Idx,
Sourcepub fn ensure(&mut self, min_domain_size: usize)
pub fn ensure(&mut self, min_domain_size: usize)
Ensure that the set can hold at least min_domain_size elements.
pub fn new_empty() -> GrowableBitSet<T>
pub fn with_capacity(capacity: usize) -> GrowableBitSet<T>
pub fn insert_range(&mut self, elems: Range<T>)
pub fn clear(&mut self)
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, elem: T) -> bool
pub fn contains_any(&self, elems: Range<T>) -> bool
pub fn iter(&self) -> BitIter<'_, T> ⓘ
pub fn len(&self) -> usize
Sourcepub fn union<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
pub fn union<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
Sets self = self | other and returns true if self changed
(i.e., if new bits were added).
Sourcepub fn subtract<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
pub fn subtract<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
Sets self = self - other and returns true if self changed.
(i.e., if any bits were removed).
Sourcepub fn intersect<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
pub fn intersect<Rhs>(&mut self, other: &Rhs) -> boolwhere
GrowableBitSet<T>: BitRelations<Rhs>,
Sets self = self & other and return true if self changed.
(i.e., if any bits were removed).
Trait Implementations§
Source§impl<T> BitRelations<GrowableBitSet<T>> for GrowableBitSet<T>where
T: Idx,
impl<T> BitRelations<GrowableBitSet<T>> for GrowableBitSet<T>where
T: Idx,
fn union(&mut self, other: &GrowableBitSet<T>) -> bool
fn subtract(&mut self, other: &GrowableBitSet<T>) -> bool
fn intersect(&mut self, other: &GrowableBitSet<T>) -> bool
Source§impl<T> Clone for GrowableBitSet<T>
impl<T> Clone for GrowableBitSet<T>
Source§fn clone(&self) -> GrowableBitSet<T>
fn clone(&self) -> GrowableBitSet<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for GrowableBitSet<T>
impl<T> Debug for GrowableBitSet<T>
Source§impl<T> Default for GrowableBitSet<T>where
T: Idx,
impl<T> Default for GrowableBitSet<T>where
T: Idx,
Source§fn default() -> GrowableBitSet<T>
fn default() -> GrowableBitSet<T>
Returns the “default value” for a type. Read more
Source§impl<T> From<DenseBitSet<T>> for GrowableBitSet<T>where
T: Idx,
impl<T> From<DenseBitSet<T>> for GrowableBitSet<T>where
T: Idx,
Source§fn from(bit_set: DenseBitSet<T>) -> GrowableBitSet<T>
fn from(bit_set: DenseBitSet<T>) -> GrowableBitSet<T>
Converts to this type from the input type.
Source§impl<T> From<GrowableBitSet<T>> for DenseBitSet<T>where
T: Idx,
impl<T> From<GrowableBitSet<T>> for DenseBitSet<T>where
T: Idx,
Source§fn from(bit_set: GrowableBitSet<T>) -> DenseBitSet<T>
fn from(bit_set: GrowableBitSet<T>) -> DenseBitSet<T>
Converts to this type from the input type.
Source§impl<T> PartialEq for GrowableBitSet<T>
impl<T> PartialEq for GrowableBitSet<T>
Source§fn eq(&self, other: &GrowableBitSet<T>) -> bool
fn eq(&self, other: &GrowableBitSet<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T> StructuralPartialEq for GrowableBitSet<T>
Auto Trait Implementations§
impl<T> Freeze for GrowableBitSet<T>
impl<T> RefUnwindSafe for GrowableBitSet<T>where
T: RefUnwindSafe,
impl<T> Send for GrowableBitSet<T>where
T: Send,
impl<T> Sync for GrowableBitSet<T>where
T: Sync,
impl<T> Unpin for GrowableBitSet<T>where
T: Unpin,
impl<T> UnsafeUnpin for GrowableBitSet<T>
impl<T> UnwindSafe for GrowableBitSet<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more