# Struct enum_set::EnumSet
[−]
[src]

pub struct EnumSet<E> { /* fields omitted */ }

A specialized set implementation to use enum types.

## Methods

`impl<E: CLike> EnumSet<E>`

[src]

`fn new() -> Self`

Returns an empty `EnumSet`

.

`fn len(&self) -> usize`

Returns the number of elements in the set.

`fn is_empty(&self) -> bool`

Checks if the set is empty.

`fn clear(&mut self)`

Removes all elements from the set.

`fn is_disjoint(&self, other: &Self) -> bool`

Returns `true`

if the set has no elements in common with `other`

.

This is equivalent to checking for an empty intersection.

`fn is_superset(&self, other: &Self) -> bool`

Returns `true`

if the set is a superset of `other`

.

`fn is_subset(&self, other: &Self) -> bool`

Returns `true`

if the set is a subset of `other`

.

`fn union(&self, other: Self) -> Self`

Returns the union of the set and `other`

.

`fn intersection(&self, other: Self) -> Self`

Returns the intersection of the set and `other`

.

`fn difference(&self, other: Self) -> Self`

Returns the difference between the set and `other`

.

`fn symmetric_difference(&self, other: Self) -> Self`

Returns the symmetric difference between the set and `other`

.

`fn insert(&mut self, value: E) -> bool`

Adds the given value to the set.

Returns `true`

if the value was not already present in the set.

`fn remove(&mut self, value: &E) -> bool`

Removes a value from the set.

Returns `true`

if the value was present in the set.

`fn contains(&self, value: &E) -> bool`

Returns `true`

if the set contains the given value.

`fn iter(&self) -> Iter<E>`

Returns an iterator over the set's elements.

## Trait Implementations

`impl<E: Copy> Copy for EnumSet<E>`

[src]

`impl<E: Clone> Clone for 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

Performs copy-assignment from `source`

. Read more

`impl<E: PartialEq> PartialEq for EnumSet<E>`

[src]

`fn eq(&self, __arg_0: &EnumSet<E>) -> bool`

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, __arg_0: &EnumSet<E>) -> bool`

This method tests for `!=`

.

`impl<E: Eq> Eq for EnumSet<E>`

[src]

`impl<E: PartialOrd> PartialOrd for EnumSet<E>`

[src]

`fn partial_cmp(&self, __arg_0: &EnumSet<E>) -> Option<Ordering>`

This method returns an ordering between `self`

and `other`

values if one exists. Read more

`fn lt(&self, __arg_0: &EnumSet<E>) -> bool`

This method tests less than (for `self`

and `other`

) and is used by the `<`

operator. Read more

`fn le(&self, __arg_0: &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, __arg_0: &EnumSet<E>) -> bool`

This method tests greater than (for `self`

and `other`

) and is used by the `>`

operator. Read more

`fn ge(&self, __arg_0: &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> Ord for EnumSet<E>`

[src]

`fn cmp(&self, __arg_0: &EnumSet<E>) -> Ordering`

This method returns an `Ordering`

between `self`

and `other`

. Read more

`impl<E: CLike + Debug> Debug for EnumSet<E>`

[src]

`impl<E: CLike> Hash for EnumSet<E>`

[src]

`fn hash<H: Hasher>(&self, state: &mut H)`

Feeds this value into the given [`Hasher`

]. Read more

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more

`impl<E: CLike> Sub for EnumSet<E>`

[src]

`type Output = Self`

The resulting type after applying the `-`

operator

`fn sub(self, other: Self) -> Self`

The method for the `-`

operator

`impl<E: CLike> BitOr for EnumSet<E>`

[src]

`type Output = Self`

The resulting type after applying the `|`

operator

`fn bitor(self, other: Self) -> Self`

The method for the `|`

operator

`impl<E: CLike> BitAnd for EnumSet<E>`

[src]

`type Output = Self`

The resulting type after applying the `&`

operator

`fn bitand(self, other: Self) -> Self`

The method for the `&`

operator

`impl<E: CLike> BitXor for EnumSet<E>`

[src]

`type Output = Self`

The resulting type after applying the `^`

operator

`fn bitxor(self, other: Self) -> Self`

The method for the `^`

operator

`impl<E: CLike> Default for EnumSet<E>`

[src]

`impl<E: CLike> FromIterator<E> for EnumSet<E>`

[src]

`fn from_iter<I: IntoIterator<Item = E>>(iterator: I) -> Self`

Creates a value from an iterator. Read more

`impl<E: CLike> Extend<E> for EnumSet<E>`

[src]

`fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)`

Extends a collection with the contents of an iterator. Read more