pub struct EnumSet<E: EnumLike> { /* private fields */ }
Expand description
A BitSet
indexed by an EnumLike
type.
Implementations§
Source§impl<E: EnumLike> EnumSet<E>
impl<E: EnumLike> EnumSet<E>
Sourcepub fn into_bit_set(self) -> BitSet
pub fn into_bit_set(self) -> BitSet
Returns the inner BitSet
.
Sourcepub fn from_bit_set(inner: BitSet) -> Self
pub fn from_bit_set(inner: BitSet) -> Self
Constructs an EnumSet
from a BitSet
.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Attemps to minimalize the memory usage of the inner BitSet
.
Sourcepub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, E>
pub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, E>
Iterator over each element in set || other
.
Sourcepub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, E>
pub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, E>
Iterator over each element in set && other
.
Sourcepub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, E>
pub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, E>
Iterator over each element in set - other
.
Sourcepub fn symmetric_difference<'a>(
&'a self,
other: &'a Self,
) -> SymmetricDifference<'a, E>
pub fn symmetric_difference<'a>( &'a self, other: &'a Self, ) -> SymmetricDifference<'a, E>
Iterator over each element in set ^ other
.
Sourcepub fn union_with(&mut self, other: &Self)
pub fn union_with(&mut self, other: &Self)
Computes the union with the other set, in-place.
Sourcepub fn intersect_with(&mut self, other: &Self)
pub fn intersect_with(&mut self, other: &Self)
Computes the intersection with the other set, in-place.
Sourcepub fn difference_with(&mut self, other: &Self)
pub fn difference_with(&mut self, other: &Self)
Computes the difference with the other set, in-place.
Sourcepub fn symmetric_difference_with(&mut self, other: &Self)
pub fn symmetric_difference_with(&mut self, other: &Self)
Computes the symmetric difference with the other set, in-place.
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
.
Sourcepub fn is_subset(&self, other: &Self) -> bool
pub fn is_subset(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
Sourcepub fn is_superset(&self, other: &Self) -> bool
pub fn is_superset(&self, other: &Self) -> bool
Returns true
if the set has no elements in common with other
.
Trait Implementations§
Source§impl<E: EnumLike> Extend<E> for EnumSet<E>
impl<E: EnumLike> 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: EnumLike> FromIterator<E> for EnumSet<E>
impl<E: EnumLike> FromIterator<E> for EnumSet<E>
Source§fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, E: EnumLike> IntoIterator for &'a EnumSet<E>
impl<'a, E: EnumLike> IntoIterator for &'a EnumSet<E>
Source§impl<E: Ord + EnumLike> Ord for EnumSet<E>
impl<E: Ord + EnumLike> 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 + EnumLike> PartialOrd for EnumSet<E>
impl<E: PartialOrd + EnumLike> PartialOrd for EnumSet<E>
impl<E: Eq + EnumLike> Eq for EnumSet<E>
impl<E: EnumLike> 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