Struct enum_set2::EnumSet [−][src]
pub struct EnumSet<E: EnumLike> { /* fields omitted */ }
A BitSet
indexed by an EnumLike
type.
Methods
impl<E: EnumLike> EnumSet<E>
[src]
impl<E: EnumLike> EnumSet<E>
pub fn into_bit_set(self) -> BitSet
[src]
pub fn into_bit_set(self) -> BitSet
Returns the inner BitSet
.
pub fn get_ref(&self) -> &BitSet
[src]
pub fn get_ref(&self) -> &BitSet
Returns a reference to the inner BitSet
.
pub fn from_bit_set(inner: BitSet) -> Self
[src]
pub fn from_bit_set(inner: BitSet) -> Self
Constructs an EnumSet
from a BitSet
.
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new EnumSet
.
pub fn shrink_to_fit(&mut self)
[src]
pub fn shrink_to_fit(&mut self)
Attemps to minimalize the memory usage of the inner BitSet
.
ⓘImportant traits for WrapIter<E, I>pub fn iter(&self) -> WrapIter<E, Iter<u32>>
[src]
pub fn iter(&self) -> WrapIter<E, Iter<u32>>
Iterator over each element in the set.
pub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, E>
[src]
pub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, E>
Iterator over each element in set || other
.
pub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, E>
[src]
pub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, E>
Iterator over each element in set && other
.
pub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, E>
[src]
pub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, E>
Iterator over each element in set - other
.
pub fn symmetric_difference<'a>(
&'a self,
other: &'a Self
) -> SymmetricDifference<'a, E>
[src]
pub fn symmetric_difference<'a>(
&'a self,
other: &'a Self
) -> SymmetricDifference<'a, E>
Iterator over each element in set ^ other
.
pub fn union_with(&mut self, other: &Self)
[src]
pub fn union_with(&mut self, other: &Self)
Computes the union with the other set, in-place.
pub fn intersect_with(&mut self, other: &Self)
[src]
pub fn intersect_with(&mut self, other: &Self)
Computes the intersection with the other set, in-place.
pub fn difference_with(&mut self, other: &Self)
[src]
pub fn difference_with(&mut self, other: &Self)
Computes the difference with the other set, in-place.
pub fn symmetric_difference_with(&mut self, other: &Self)
[src]
pub fn symmetric_difference_with(&mut self, other: &Self)
Computes the symmetric difference with the other set, in-place.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of elements in the set.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true
if there are no elements in the set.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clears all elements in the set.
pub fn contains(&self, value: E) -> bool
[src]
pub fn contains(&self, value: E) -> bool
Returns true
if the set contains this value.
pub fn is_disjoint(&self, other: &Self) -> bool
[src]
pub fn is_disjoint(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
pub fn is_subset(&self, other: &Self) -> bool
[src]
pub fn is_subset(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
pub fn is_superset(&self, other: &Self) -> bool
[src]
pub fn is_superset(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
pub fn insert(&mut self, value: E) -> bool
[src]
pub fn insert(&mut self, value: E) -> bool
Returns true
if the value was not already present in the set
pub fn remove(&mut self, value: E) -> bool
[src]
pub fn remove(&mut self, value: E) -> bool
Returns true
if the value was already present in the set
Trait Implementations
impl<E: Clone + EnumLike> Clone for EnumSet<E>
[src]
impl<E: Clone + EnumLike> Clone for EnumSet<E>
fn clone(&self) -> EnumSet<E>
[src]
fn clone(&self) -> EnumSet<E>
Returns 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<E: Hash + EnumLike> Hash for EnumSet<E>
[src]
impl<E: Hash + EnumLike> Hash for EnumSet<E>
fn hash<__HE: Hasher>(&self, state: &mut __HE)
[src]
fn hash<__HE: Hasher>(&self, state: &mut __HE)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<E: PartialEq + EnumLike> PartialEq for EnumSet<E>
[src]
impl<E: PartialEq + EnumLike> PartialEq for EnumSet<E>
fn eq(&self, other: &EnumSet<E>) -> bool
[src]
fn eq(&self, other: &EnumSet<E>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &EnumSet<E>) -> bool
[src]
fn ne(&self, other: &EnumSet<E>) -> bool
This method tests for !=
.
impl<E: Eq + EnumLike> Eq for EnumSet<E>
[src]
impl<E: Eq + EnumLike> Eq for EnumSet<E>
impl<E: PartialOrd + EnumLike> PartialOrd for EnumSet<E>
[src]
impl<E: PartialOrd + EnumLike> PartialOrd for EnumSet<E>
fn partial_cmp(&self, other: &EnumSet<E>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &EnumSet<E>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &EnumSet<E>) -> bool
[src]
fn lt(&self, other: &EnumSet<E>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &EnumSet<E>) -> bool
[src]
fn le(&self, other: &EnumSet<E>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &EnumSet<E>) -> bool
[src]
fn gt(&self, other: &EnumSet<E>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &EnumSet<E>) -> bool
[src]
fn ge(&self, other: &EnumSet<E>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<E: Ord + EnumLike> Ord for EnumSet<E>
[src]
impl<E: Ord + EnumLike> Ord for EnumSet<E>
fn cmp(&self, other: &EnumSet<E>) -> Ordering
[src]
fn cmp(&self, other: &EnumSet<E>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<E: EnumLike> Default for EnumSet<E>
[src]
impl<E: EnumLike> Default for EnumSet<E>
impl<E: EnumLike> FromIterator<E> for EnumSet<E>
[src]
impl<E: EnumLike> FromIterator<E> for EnumSet<E>
fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl<E: EnumLike> Extend<E> for EnumSet<E>
[src]
impl<E: EnumLike> Extend<E> for EnumSet<E>
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<E: EnumLike + Debug> Debug for EnumSet<E>
[src]
impl<E: EnumLike + Debug> Debug for EnumSet<E>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, E: EnumLike> IntoIterator for &'a EnumSet<E>
[src]
impl<'a, E: EnumLike> IntoIterator for &'a EnumSet<E>