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> EnumSet<E> where
E: CLike,
[src]
impl<E> EnumSet<E> where
E: CLike,
[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]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<EnumSet<E>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<EnumSet<E>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl<'a, E> Extend<&'a E> for EnumSet<E> where
E: 'a + CLike + Copy,
[src]
impl<'a, E> Extend<&'a E> for EnumSet<E> where
E: 'a + CLike + Copy,
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = &'a E>,
[src]
I: IntoIterator<Item = &'a E>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<E> Extend<E> for EnumSet<E> where
E: CLike,
[src]
impl<E> Extend<E> for EnumSet<E> where
E: CLike,
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = E>,
[src]
I: IntoIterator<Item = E>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<E> FromIterator<E> for EnumSet<E> where
E: CLike,
[src]
impl<E> FromIterator<E> for EnumSet<E> where
E: CLike,
[src]pub fn from_iter<I>(iter: I) -> EnumSet<E> where
I: IntoIterator<Item = E>,
[src]
I: IntoIterator<Item = E>,
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]pub fn partial_cmp(&self, other: &EnumSet<E>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<E> Serialize for EnumSet<E>
[src]
impl<E> Serialize for EnumSet<E>
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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,
Blanket Implementations
impl<T> CallHasher for T where
T: Hash,
[src]
impl<T> CallHasher for T where
T: Hash,
[src]impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> CollisionObjectHandle for T where
T: 'static + Copy + Hash + PartialEq<T> + Eq + Send + Sync,
[src]
T: 'static + Copy + Hash + PartialEq<T> + Eq + Send + Sync,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<N> NodeTrait for N where
N: Copy + Ord + Hash,
[src]
N: Copy + Ord + Hash,
impl<T> Slottable for T where
T: Copy,
[src]
T: Copy,