Struct rin_util::EnumSet [−][src]
pub struct EnumSet<E> { /* fields omitted */ }
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.
Implementations
impl<E: CLike> EnumSet<E>
[src]
impl<E: CLike> EnumSet<E>
[src]pub fn len(&self) -> usize
[src]
Returns the number of elements in the given EnumSet
.
pub fn is_empty(&self) -> bool
[src]
Returns true if the EnumSet
is empty.
pub fn clear(&mut self)
[src]
pub fn is_disjoint(&self, other: &EnumSet<E>) -> bool
[src]
Returns false
if the EnumSet
contains any enum of the given EnumSet
.
pub fn is_superset(&self, other: &EnumSet<E>) -> bool
[src]
Returns true
if a given EnumSet
is included in this EnumSet
.
pub fn is_subset(&self, other: &EnumSet<E>) -> bool
[src]
Returns true
if this EnumSet
is included in the given EnumSet
.
pub fn union(&self, e: EnumSet<E>) -> EnumSet<E>
[src]
Returns the union of both EnumSets
.
pub fn intersection(&self, e: EnumSet<E>) -> EnumSet<E>
[src]
Returns the intersection of both EnumSets
.
pub fn insert(&mut self, e: E) -> bool
[src]
Adds an enum to the EnumSet
, and returns true
if it wasn’t there before
pub fn remove(&mut self, e: &E) -> bool
[src]
Removes an enum from the EnumSet
pub fn contains(&self, e: &E) -> bool
[src]
Returns true
if an EnumSet
contains a given enum.
pub fn iter(&self) -> Iter<E>
[src]
Returns an iterator over an EnumSet
.
Trait Implementations
impl<'de, E> Deserialize<'de> for EnumSet<E>
[src]
impl<'de, E> Deserialize<'de> for EnumSet<E>
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E>
[src]
impl<'a, E: 'a + CLike + Copy> Extend<&'a E> for EnumSet<E>
[src]fn extend<I: IntoIterator<Item = &'a E>>(&mut self, iter: I)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<E: CLike> Extend<E> for EnumSet<E>
[src]
impl<E: CLike> Extend<E> for EnumSet<E>
[src]fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<E: CLike> FromIterator<E> for EnumSet<E>
[src]
impl<E: CLike> FromIterator<E> for EnumSet<E>
[src]fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> EnumSet<E>
[src]
impl<'a, E> IntoIterator for &'a EnumSet<E> where
E: CLike,
[src]
impl<'a, E> IntoIterator for &'a EnumSet<E> where
E: CLike,
[src]impl<E> PartialOrd<EnumSet<E>> for EnumSet<E>
[src]
impl<E> PartialOrd<EnumSet<E>> for EnumSet<E>
[src]impl<E> Copy for EnumSet<E>
[src]
impl<E> Eq for EnumSet<E>
[src]
Auto Trait Implementations
impl<E> RefUnwindSafe for EnumSet<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> Send for EnumSet<E> where
E: Send,
E: Send,
impl<E> Sync for EnumSet<E> where
E: Sync,
E: Sync,
impl<E> Unpin for EnumSet<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for EnumSet<E> where
E: UnwindSafe,
E: UnwindSafe,