Struct rustc_data_structures::indexed_set::IdxSet [−][src]
pub struct IdxSet<T: Idx> { /* fields omitted */ }
Represents a set of some element type E, where each E is identified by some
unique index type T.
In other words, T is the type used to index into the bitvector
this type uses to represent the set of object it holds.
The representation is dense, using one bit per possible element.
Methods
impl<T: Idx> IdxSet<T>[src]
impl<T: Idx> IdxSet<T>pub fn new_filled(universe_size: usize) -> Self[src]
pub fn new_filled(universe_size: usize) -> SelfCreates set holding every element whose index falls in range 0..universe_size.
pub fn new_empty(universe_size: usize) -> Self[src]
pub fn new_empty(universe_size: usize) -> SelfCreates set holding no elements.
pub fn to_hybrid(&self) -> HybridIdxSet<T>[src]
pub fn to_hybrid(&self) -> HybridIdxSet<T>Duplicates as a hybrid set.
pub fn clear(&mut self)[src]
pub fn clear(&mut self)Removes all elements
pub fn set_up_to(&mut self, universe_size: usize)[src]
pub fn set_up_to(&mut self, universe_size: usize)Sets all elements up to universe_size
pub fn remove(&mut self, elem: &T) -> bool[src]
pub fn remove(&mut self, elem: &T) -> boolRemoves elem from the set self; returns true iff this changed self.
pub fn add(&mut self, elem: &T) -> bool[src]
pub fn add(&mut self, elem: &T) -> boolAdds elem to the set self; returns true iff this changed self.
pub fn contains(&self, elem: &T) -> bool[src]
pub fn contains(&self, elem: &T) -> boolReturns true iff set self contains elem.
pub fn words(&self) -> &[Word][src]
pub fn words(&self) -> &[Word]pub fn words_mut(&mut self) -> &mut [Word][src]
pub fn words_mut(&mut self) -> &mut [Word]pub fn overwrite(&mut self, other: &IdxSet<T>)[src]
pub fn overwrite(&mut self, other: &IdxSet<T>)Efficiently overwrite self with other. Panics if self and other
don't have the same length.
pub fn union(&mut self, other: &IdxSet<T>) -> bool[src]
pub fn union(&mut self, other: &IdxSet<T>) -> boolSet self = self | other and return true if self changed
(i.e., if new bits were added).
pub fn union_hybrid(&mut self, other: &HybridIdxSet<T>) -> bool[src]
pub fn union_hybrid(&mut self, other: &HybridIdxSet<T>) -> boolLike union(), but takes a HybridIdxSet argument.
pub fn subtract(&mut self, other: &IdxSet<T>) -> bool[src]
pub fn subtract(&mut self, other: &IdxSet<T>) -> boolSet self = self - other and return true if self changed.
(i.e., if any bits were removed).
pub fn subtract_hybrid(&mut self, other: &HybridIdxSet<T>) -> bool[src]
pub fn subtract_hybrid(&mut self, other: &HybridIdxSet<T>) -> boolLike subtract(), but takes a HybridIdxSet argument.
pub fn intersect(&mut self, other: &IdxSet<T>) -> bool[src]
pub fn intersect(&mut self, other: &IdxSet<T>) -> boolSet self = self & other and return true if self changed.
(i.e., if any bits were removed).
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<T>[src]
pub fn iter(&self) -> Iter<T>Trait Implementations
impl<T: Eq + Idx> Eq for IdxSet<T>[src]
impl<T: Eq + Idx> Eq for IdxSet<T>impl<T: PartialEq + Idx> PartialEq for IdxSet<T>[src]
impl<T: PartialEq + Idx> PartialEq for IdxSet<T>fn eq(&self, other: &IdxSet<T>) -> bool[src]
fn eq(&self, other: &IdxSet<T>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &IdxSet<T>) -> bool[src]
fn ne(&self, other: &IdxSet<T>) -> boolThis method tests for !=.
impl<T: Idx> Clone for IdxSet<T>[src]
impl<T: Idx> Clone for IdxSet<T>fn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T: Idx> Encodable for IdxSet<T>[src]
impl<T: Idx> Encodable for IdxSet<T>impl<T: Idx> Decodable for IdxSet<T>[src]
impl<T: Idx> Decodable for IdxSet<T>impl<T: Idx> Debug for IdxSet<T>[src]
impl<T: Idx> Debug for IdxSet<T>fn fmt(&self, w: &mut Formatter) -> Result[src]
fn fmt(&self, w: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<I: Idx, CTX> HashStable<CTX> for IdxSet<I>[src]
impl<I: Idx, CTX> HashStable<CTX> for IdxSet<I>fn hash_stable<W: StableHasherResult>(
&self,
ctx: &mut CTX,
hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
ctx: &mut CTX,
hasher: &mut StableHasher<W>
)