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: PartialOrd + EnumSetType> PartialOrd for EnumSet<T> where
T::Repr: PartialOrd, [src]
T::Repr: PartialOrd,
fn partial_cmp(&self, __arg_0: &EnumSet<T>) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T: Ord + EnumSetType> Ord for EnumSet<T> where
T::Repr: Ord, [src]
T::Repr: Ord,
fn cmp(&self, __arg_0: &EnumSet<T>) -> Ordering[src]
This method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.22.0[src]
Compares and returns the minimum of two values. Read more
impl<T: PartialEq + EnumSetType> PartialEq for EnumSet<T> where
T::Repr: PartialEq, [src]
T::Repr: PartialEq,
fn eq(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &EnumSet<T>) -> bool[src]
This method tests for !=.
impl<T: Eq + EnumSetType> Eq for EnumSet<T> where
T::Repr: Eq, [src]
T::Repr: Eq,
impl<T: Hash + EnumSetType> Hash for EnumSet<T> where
T::Repr: Hash, [src]
T::Repr: Hash,
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)[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
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.