[−][src]Struct enum_set::EnumSet
A specialized set implementation to use enum types.
Methods
impl<E: CLike> EnumSet<E>
[src]
pub fn new() -> Self
[src]
Returns an empty EnumSet
.
pub fn len(&self) -> usize
[src]
Returns the number of elements in the set.
pub fn is_empty(&self) -> bool
[src]
Checks if the set is empty.
pub fn clear(&mut self)
[src]
Removes all elements from the set.
pub fn is_disjoint(&self, other: &Self) -> bool
[src]
Returns true
if the set has no elements in common with other
.
This is equivalent to checking for an empty intersection.
pub fn is_superset(&self, other: &Self) -> bool
[src]
Returns true
if the set is a superset of other
.
pub fn is_subset(&self, other: &Self) -> bool
[src]
Returns true
if the set is a subset of other
.
pub fn union(&self, other: Self) -> Self
[src]
Returns the union of the set and other
.
pub fn intersection(&self, other: Self) -> Self
[src]
Returns the intersection of the set and other
.
pub fn difference(&self, other: Self) -> Self
[src]
Returns the difference between the set and other
.
pub fn symmetric_difference(&self, other: Self) -> Self
[src]
Returns the symmetric difference between the set and other
.
pub fn insert(&mut self, value: E) -> bool
[src]
Adds the given value to the set.
Returns true
if the value was not already present in the set.
pub fn remove(&mut self, value: &E) -> bool
[src]
Removes a value from the set.
Returns true
if the value was present in the set.
pub fn contains(&self, value: &E) -> bool
[src]
Returns true
if the set contains the given value.
ⓘImportant traits for Iter<E>pub fn iter(&self) -> Iter<E>
[src]
Returns an iterator over the set's elements.
Trait Implementations
impl<E: Ord> Ord for EnumSet<E>
[src]
fn cmp(&self, other: &EnumSet<E>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more
impl<'a, E: CLike> IntoIterator for &'a EnumSet<E>
[src]
type Item = E
The type of the elements being iterated over.
type IntoIter = Iter<E>
Which kind of iterator are we turning this into?
ⓘImportant traits for Iter<E>fn into_iter(self) -> Iter<E>
[src]
impl<E: CLike> Extend<E> for EnumSet<E>
[src]
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
[src]
impl<E: Eq> Eq for EnumSet<E>
[src]
impl<E: PartialOrd> PartialOrd<EnumSet<E>> for EnumSet<E>
[src]
fn partial_cmp(&self, other: &EnumSet<E>) -> Option<Ordering>
[src]
fn lt(&self, other: &EnumSet<E>) -> bool
[src]
fn le(&self, other: &EnumSet<E>) -> bool
[src]
fn gt(&self, other: &EnumSet<E>) -> bool
[src]
fn ge(&self, other: &EnumSet<E>) -> bool
[src]
impl<E: CLike> Default for EnumSet<E>
[src]
impl<E: Copy> Copy for EnumSet<E>
[src]
impl<E: PartialEq> PartialEq<EnumSet<E>> for EnumSet<E>
[src]
impl<E: Clone> Clone for EnumSet<E>
[src]
fn clone(&self) -> EnumSet<E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<E: CLike + Debug> Debug for EnumSet<E>
[src]
impl<E: CLike> Hash for EnumSet<E>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<E: CLike> Sub<EnumSet<E>> for EnumSet<E>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self
[src]
impl<E: CLike> SubAssign<EnumSet<E>> for EnumSet<E>
[src]
fn sub_assign(&mut self, other: Self)
[src]
impl<E: CLike> BitAnd<EnumSet<E>> for EnumSet<E>
[src]
type Output = Self
The resulting type after applying the &
operator.
fn bitand(self, other: Self) -> Self
[src]
impl<E: CLike> BitOr<EnumSet<E>> for EnumSet<E>
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, other: Self) -> Self
[src]
impl<E: CLike> BitXor<EnumSet<E>> for EnumSet<E>
[src]
type Output = Self
The resulting type after applying the ^
operator.
fn bitxor(self, other: Self) -> Self
[src]
impl<E: CLike> BitAndAssign<EnumSet<E>> for EnumSet<E>
[src]
fn bitand_assign(&mut self, other: Self)
[src]
impl<E: CLike> BitOrAssign<EnumSet<E>> for EnumSet<E>
[src]
fn bitor_assign(&mut self, other: Self)
[src]
impl<E: CLike> BitXorAssign<EnumSet<E>> for EnumSet<E>
[src]
fn bitxor_assign(&mut self, other: Self)
[src]
impl<E: CLike> FromIterator<E> for EnumSet<E>
[src]
fn from_iter<I: IntoIterator<Item = E>>(iterator: I) -> Self
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,