Struct enumset::EnumSet
[−]
[src]
pub struct EnumSet<T: EnumSetType>(_);
An efficient set type for enums created with the enum_set_type!
macro.
Methods
impl<T: EnumSetType> EnumSet<T>
[src]
fn new() -> Self
[src]
Returns an empty set.
fn len(&self) -> usize
[src]
Returns the number of values in this set.
fn is_empty(&self) -> bool
[src]
Checks if the set is empty.
fn clear(&mut self)
[src]
Removes all elements from the set.
fn is_disjoint(&self, other: Self) -> bool
[src]
Checks if this set shares no elements with another.
fn is_superset(&self, other: Self) -> bool
[src]
Checks if all elements in another set are in this set.
fn is_subset(&self, other: Self) -> bool
[src]
Checks if all elements of this set are in another set.
fn union(&self, other: Self) -> Self
[src]
Returns a set containing the union of all elements in both sets.
fn intersection(&self, other: Self) -> Self
[src]
Returns a set containing all elements in common with another set.
fn difference(&self, other: Self) -> Self
[src]
Returns a set with all elements of the other set removed.
fn symmetrical_difference(&self, other: Self) -> Self
[src]
Returns a set with all elements not contained in both sets.
fn contains(&self, value: T) -> bool
[src]
Checks whether this set contains a value.
fn insert(&mut self, value: T) -> bool
[src]
Adds a value to this set.
fn remove(&mut self, value: T) -> bool
[src]
Removes a value from this set.
fn insert_all(&mut self, other: Self)
[src]
Adds all elements in another set to this one.
fn remove_all(&mut self, other: Self)
[src]
Removes all values in another set from this one.
fn iter(&self) -> EnumSetIter<T>
[src]
Trait Implementations
impl<T: Copy + EnumSetType> Copy for EnumSet<T> where
T::Repr: Copy,
[src]
T::Repr: Copy,
impl<T: Clone + EnumSetType> Clone for EnumSet<T> where
T::Repr: Clone,
[src]
T::Repr: Clone,
fn clone(&self) -> EnumSet<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: EnumSetType> IntoIterator for EnumSet<T>
[src]
type Item = T
The type of the elements being iterated over.
type IntoIter = EnumSetIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl<T: EnumSetType> Sub<EnumSet<T>> for EnumSet<T>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
Performs the -
operation.
impl<T: EnumSetType> BitAnd<EnumSet<T>> for EnumSet<T>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self::Output
[src]
Performs the &
operation.
impl<T: EnumSetType> BitOr<EnumSet<T>> for EnumSet<T>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self::Output
[src]
Performs the |
operation.
impl<T: EnumSetType> BitXor<EnumSet<T>> for EnumSet<T>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self::Output
[src]
Performs the ^
operation.
impl<T: EnumSetType> BitOr<T> for EnumSet<T>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: T) -> Self::Output
[src]
Performs the |
operation.
impl<T: EnumSetType> PartialOrd for EnumSet<T>
[src]
fn partial_cmp(&self, other: &EnumSet<T>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: EnumSetType> Ord for EnumSet<T>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<T: EnumSetType> PartialEq for EnumSet<T>
[src]
fn eq(&self, other: &EnumSet<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T: EnumSetType> Eq for EnumSet<T>
[src]
impl<T: EnumSetType> Hash for EnumSet<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more