Struct BitSet
pub struct BitSet(/* private fields */);Expand description
Bit-Set like structure
Implementations§
§impl BitSet
impl BitSet
pub const fn new() -> Self
pub fn with_capacity_for(max_item: usize) -> Self
pub fn with_capacity_for(max_item: usize) -> Self
creates a new bitset with a reserved capacity for items up to the given index.
pub fn clear(&mut self)
pub fn from_range(range: Range<usize>) -> Self
pub fn insert_range(&mut self, range: Range<usize>)
pub fn contains(&self, value: usize) -> bool
pub fn is_empty(&self) -> bool
pub fn contains_all(&self, other: &Self) -> bool
pub fn insert(&mut self, value: usize) -> bool
pub fn remove(&mut self, value: usize) -> bool
pub fn first(&self) -> Option<usize>
pub fn find_next(&self, value: usize) -> Option<usize>
pub fn iter(&self) -> BitSetIter<'_> ⓘ
pub fn iter_range(&self, range: impl RangeBounds<usize>) -> BitSetIter<'_> ⓘ
pub fn drain(&mut self, range: impl RangeBounds<usize>) -> BitSetDrain<'_> ⓘ
pub fn extend_bitset(&mut self, other: &Self)
pub fn extend_bitset(&mut self, other: &Self)
Add items to this bitset. (union)
This is an ptimized version of extend.
pub fn remove_bitset(&mut self, other: &Self)
pub fn remove_bitset(&mut self, other: &Self)
remove items from this bitset (difference)
pub fn retain_bitset(&mut self, other: &Self)
pub fn retain_bitset(&mut self, other: &Self)
only retain the elements from other (intersection)
pub fn retain( &mut self, range: impl RangeBounds<usize>, predicate: impl FnMut(usize) -> bool, )
pub fn is_disjoint(&self, other: &Self) -> bool
Trait Implementations§
§impl Extend<usize> for BitSet
impl Extend<usize> for BitSet
§fn extend<I: IntoIterator<Item = usize>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = usize>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
§impl<T> FromIterator<T> for BitSetwhere
Self: Extend<T>,
impl<T> FromIterator<T> for BitSetwhere
Self: Extend<T>,
§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
§impl<'l> IntoIterator for &'l BitSet
impl<'l> IntoIterator for &'l BitSet
§impl Ord for BitSet
impl Ord for BitSet
§impl PartialOrd for BitSet
impl PartialOrd for BitSet
impl Eq for BitSet
impl StructuralPartialEq for BitSet
Auto Trait Implementations§
impl Freeze for BitSet
impl RefUnwindSafe for BitSet
impl Send for BitSet
impl Sync for BitSet
impl Unpin for BitSet
impl UnwindSafe for BitSet
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