Struct collections::enum_set::EnumSet
[−]
[src]
pub struct EnumSet<E> { // some fields omitted }
enumset
): 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
, as determined by the
CLike
trait, changes while the item is in the set. This is normally only
possible through Cell
, RefCell
, global state, I/O, or unsafe code.
Methods
impl<E: CLike> EnumSet<E>
fn new() -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
Returns an empty EnumSet
.
fn len(&self) -> usize
enumset
): matches collection reform specification, waiting for dust to settle
Returns the number of elements in the given EnumSet
.
fn is_empty(&self) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Returns true if the EnumSet
is empty.
fn clear(&mut self)
enumset
): matches collection reform specification, waiting for dust to settle
fn is_disjoint(&self, other: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Returns false
if the EnumSet
contains any enum of the given EnumSet
.
fn is_superset(&self, other: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Returns true
if a given EnumSet
is included in this EnumSet
.
fn is_subset(&self, other: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Returns true
if this EnumSet
is included in the given EnumSet
.
fn union(&self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
Returns the union of both EnumSets
.
fn intersection(&self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
Returns the intersection of both EnumSets
.
fn insert(&mut self, e: E) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Adds an enum to the EnumSet
, and returns true
if it wasn't there before
fn remove(&mut self, e: &E) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Removes an enum from the EnumSet
fn contains(&self, e: &E) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
Returns true
if an EnumSet
contains a given enum.
fn iter(&self) -> Iter<E>
enumset
): matches collection reform specification, waiting for dust to settle
Returns an iterator over an EnumSet
.
Trait Implementations
impl<E> Copy for EnumSet<E>
impl<E> Clone for EnumSet<E>
fn clone(&self) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
fn clone_from(&mut self, source: &Self)
1.0.0
impl<E: CLike + Debug> Debug for EnumSet<E>
1.0.0
impl<E: CLike> Sub for EnumSet<E>
type Output = EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
fn sub(self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
impl<E: CLike> BitOr for EnumSet<E>
type Output = EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
fn bitor(self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
impl<E: CLike> BitAnd for EnumSet<E>
type Output = EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
fn bitand(self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
impl<E: CLike> BitXor for EnumSet<E>
type Output = EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
fn bitxor(self, e: EnumSet<E>) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
impl<E: CLike> FromIterator<E> for EnumSet<E>
fn from_iter<I: IntoIterator<Item=E>>(iter: I) -> EnumSet<E>
enumset
): matches collection reform specification, waiting for dust to settle
impl<'a, E> IntoIterator for &'a EnumSet<E> where E: CLike
1.0.0
impl<E: CLike> Extend<E> for EnumSet<E>
fn extend<I: IntoIterator<Item=E>>(&mut self, iter: I)
enumset
): matches collection reform specification, waiting for dust to settle
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E>
1.2.0
fn extend<I: IntoIterator<Item=&'a E>>(&mut self, iter: I)
Derived Implementations
impl<E: Hash> Hash for EnumSet<E>
fn hash<__HE: Hasher>(&self, __arg_0: &mut __HE)
enumset
): matches collection reform specification, waiting for dust to settle
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
impl<E: Ord> Ord for EnumSet<E>
fn cmp(&self, __arg_0: &EnumSet<E>) -> Ordering
enumset
): matches collection reform specification, waiting for dust to settle
impl<E: PartialOrd> PartialOrd for EnumSet<E>
fn partial_cmp(&self, __arg_0: &EnumSet<E>) -> Option<Ordering>
enumset
): matches collection reform specification, waiting for dust to settle
fn lt(&self, __arg_0: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
fn le(&self, __arg_0: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
fn gt(&self, __arg_0: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle
fn ge(&self, __arg_0: &EnumSet<E>) -> bool
enumset
): matches collection reform specification, waiting for dust to settle