Struct enumset::EnumSet

source ·
pub struct EnumSet<T: EnumSetType> { /* private fields */ }
Expand description

An efficient set type for enums.

Implementations

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).

This is the same as EnumSet::variant_count except in enums with “sparse” variants. (e.g. enum Foo { A = 10, B = 20 })

The number of valid variants in this enumset.

This is the same as EnumSet::bit_width except in enums with “sparse” variants. (e.g. enum Foo { A = 10, B = 20 })

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.

Creates an iterator over the values in this set.

Trait Implementations

The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more
The resulting type after applying the | operator.
Performs the | operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Performs the ^= operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
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
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
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
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.