Struct enumset::EnumSet[][src]

pub struct EnumSet<T: EnumSetType> { /* fields omitted */ }

An efficient set type for enums created with the enum_set_type! macro.

Methods

impl<T: EnumSetType> EnumSet<T>
[src]

Returns an empty set.

Returns a set containing a single value.

Returns an empty set.

Returns a set with all bits set.

Total number of bits this enumset uses. Note that the actual amount of space used is rounded up to the next highest integer type (u8, u16, u32, u64, or u128).

Returns the raw bits of this set

Constructs a bitset from raw bits.

Panics

If bits not in the enum are set.

Returns the number of values in this set.

Checks if the set is empty.

Removes all elements from the set.

Checks if this set shares no elements with another.

Checks if all elements in another set are in this set.

Checks if all elements of this set are in another set.

Returns a set containing the union of all elements in both sets.

Returns a set containing all elements in common with another set.

Returns a set with all elements of the other set removed.

Returns a set with all elements not contained in both sets.

Returns a set containing all elements not in this set.

Checks whether this set contains a value.

Adds a value to this set.

Removes a value from this set.

Adds all elements in another set to this one.

Removes all values in another set from this one.

Important traits for EnumSetIter<T>

Creates an iterator over the values in this set.

Trait Implementations

impl<T: Copy + EnumSetType> Copy for EnumSet<T> where
    T::Repr: Copy
[src]

impl<T: Clone + EnumSetType> Clone for EnumSet<T> where
    T::Repr: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialOrd + EnumSetType> PartialOrd for EnumSet<T> where
    T::Repr: PartialOrd
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<T: PartialEq + EnumSetType> PartialEq for EnumSet<T> where
    T::Repr: PartialEq
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Eq + EnumSetType> Eq for EnumSet<T> where
    T::Repr: Eq
[src]

impl<T: Hash + EnumSetType> Hash for EnumSet<T> where
    T::Repr: Hash
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: EnumSetType> IntoIterator for EnumSet<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<T: EnumSetType, O: Into<EnumSet<T>>> Sub<O> for EnumSet<T>
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitAnd<O> for EnumSet<T>
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitOr<O> for EnumSet<T>
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitXor<O> for EnumSet<T>
[src]

The resulting type after applying the ^ operator.

Performs the ^ operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> SubAssign<O> for EnumSet<T>
[src]

Performs the -= operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitAndAssign<O> for EnumSet<T>
[src]

Performs the &= operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitOrAssign<O> for EnumSet<T>
[src]

Performs the |= operation.

impl<T: EnumSetType, O: Into<EnumSet<T>>> BitXorAssign<O> for EnumSet<T>
[src]

Performs the ^= operation.

impl<T: EnumSetType> Not for EnumSet<T>
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl<T: EnumSetType> From<T> for EnumSet<T>
[src]

Performs the conversion.

impl<T: EnumSetType> PartialEq<T> for EnumSet<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: EnumSetType + Debug> Debug for EnumSet<T>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for EnumSet<T> where
    <T as EnumSetType>::Repr: Send

impl<T> Sync for EnumSet<T> where
    <T as EnumSetType>::Repr: Sync