Struct collections::enum_set::EnumSet
[−]
[src]
pub struct EnumSet<E> {
// some fields omitted
}: matches collection reform specification, waiting for dust to settle
A specialized set implementation to use enum types.
It is a logic error for an item to be modified in such a way that the
transformation of the item to or from a usize`usize, as determined by theCLiketrait, changes while the item is in the set. This is normally only possible throughCell,`, RefCell`RefCell`, global state, I/O, or unsafe code.
Methods
impl<E: CLike> EnumSet<E>
fn new() -> EnumSet<E>
: matches collection reform specification, waiting for dust to settle
Returns an empty EnumSet`EnumSet`.
fn len(&self) -> usize
: matches collection reform specification, waiting for dust to settle
Returns the number of elements in the given EnumSet`EnumSet`.
fn is_empty(&self) -> bool
: matches collection reform specification, waiting for dust to settle
Returns true if the EnumSet`EnumSet` is empty.
fn clear(&mut self)
: matches collection reform specification, waiting for dust to settle
fn is_disjoint(&self, other: &EnumSet<E>) -> bool
: matches collection reform specification, waiting for dust to settle
Returns false`falseif the` if the EnumSet`EnumSetcontains any enum of the givenEnumSet`.
fn is_superset(&self, other: &EnumSet<E>) -> bool
: matches collection reform specification, waiting for dust to settle
Returns true`trueif a givenEnumSetis included in thisEnumSet`.
fn is_subset(&self, other: &EnumSet<E>) -> bool
: matches collection reform specification, waiting for dust to settle
Returns true`trueif this` if this EnumSet`EnumSetis included in the givenEnumSet`.
fn union(&self, e: EnumSet<E>) -> EnumSet<E>
: matches collection reform specification, waiting for dust to settle
Returns the union of both EnumSets`EnumSets`.
fn intersection(&self, e: EnumSet<E>) -> EnumSet<E>
: matches collection reform specification, waiting for dust to settle
Returns the intersection of both EnumSets`EnumSets`.
fn insert(&mut self, e: E) -> bool
: matches collection reform specification, waiting for dust to settle
Adds an enum to the EnumSet`EnumSet, and returnstrue` if it wasn't there before
fn remove(&mut self, e: &E) -> bool
: matches collection reform specification, waiting for dust to settle
Removes an enum from the EnumSet
fn contains(&self, e: &E) -> bool
: matches collection reform specification, waiting for dust to settle
Returns true`trueif an` if an EnumSet`EnumSet` contains a given enum.
fn iter(&self) -> Iter<E>
: matches collection reform specification, waiting for dust to settle
Returns an iterator over an EnumSet`EnumSet`.