pub struct EnumSet<E> { /* private fields */ }
Expand description
A specialized set implementation to use enum types.
Implementations§
Source§impl<E: CLike> EnumSet<E>
impl<E: CLike> EnumSet<E>
Sourcepub fn is_disjoint(&self, other: &Self) -> bool
pub fn is_disjoint(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
This is equivalent to checking for an empty intersection.
Sourcepub fn is_superset(&self, other: &Self) -> bool
pub fn is_superset(&self, other: &Self) -> bool
Returns true
if the set is a superset of other
.
Sourcepub fn intersection(&self, other: Self) -> Self
pub fn intersection(&self, other: Self) -> Self
Returns the intersection of the set and other
.
Sourcepub fn difference(&self, other: Self) -> Self
pub fn difference(&self, other: Self) -> Self
Returns the difference between the set and other
.
Sourcepub fn symmetric_difference(&self, other: Self) -> Self
pub fn symmetric_difference(&self, other: Self) -> Self
Returns the symmetric difference between the set and other
.
Sourcepub fn insert(&mut self, value: E) -> bool
pub fn insert(&mut self, value: E) -> bool
Adds the given value to the set.
Returns true
if the value was not already present in the set.
Trait Implementations§
Source§impl<E: CLike> BitAndAssign for EnumSet<E>
impl<E: CLike> BitAndAssign for EnumSet<E>
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&=
operation. Read moreSource§impl<E: CLike> BitOrAssign for EnumSet<E>
impl<E: CLike> BitOrAssign for EnumSet<E>
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moreSource§impl<E: CLike> BitXorAssign for EnumSet<E>
impl<E: CLike> BitXorAssign for EnumSet<E>
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the
^=
operation. Read moreSource§impl<E: CLike> Extend<E> for EnumSet<E>
impl<E: CLike> Extend<E> for EnumSet<E>
Source§fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<E: CLike> FromIterator<E> for EnumSet<E>
impl<E: CLike> FromIterator<E> for EnumSet<E>
Source§fn from_iter<I: IntoIterator<Item = E>>(iterator: I) -> Self
fn from_iter<I: IntoIterator<Item = E>>(iterator: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, E: CLike> IntoIterator for &'a EnumSet<E>
impl<'a, E: CLike> IntoIterator for &'a EnumSet<E>
Source§impl<E: Ord> Ord for EnumSet<E>
impl<E: Ord> Ord for EnumSet<E>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<E: PartialOrd> PartialOrd for EnumSet<E>
impl<E: PartialOrd> PartialOrd for EnumSet<E>
Source§impl<E: CLike> SubAssign for EnumSet<E>
impl<E: CLike> SubAssign for EnumSet<E>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl<E: Copy> Copy for EnumSet<E>
impl<E: Eq> Eq for EnumSet<E>
impl<E> StructuralPartialEq for EnumSet<E>
Auto Trait Implementations§
impl<E> Freeze for EnumSet<E>
impl<E> RefUnwindSafe for EnumSet<E>where
E: RefUnwindSafe,
impl<E> Send for EnumSet<E>where
E: Send,
impl<E> Sync for EnumSet<E>where
E: Sync,
impl<E> Unpin for EnumSet<E>where
E: Unpin,
impl<E> UnwindSafe for EnumSet<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more