pub trait Set<'a>:
Debug
+ Clone
+ Default
+ BitAndAssign<&'a Self>
+ BitAndAssign<&'a Self::Element>
+ BitOrAssign<&'a Self>
+ BitOrAssign<&'a Self::Element>
+ BitXorAssign<&'a Self>
+ BitXorAssign<&'a Self::Element>
+ SubAssign<&'a Self>
+ SubAssign<&'a Self::Element>where
Self: 'a,{
type Element: Element + 'a;
type Iter: Iterator<Item = &'a Self::Element>;
type Difference: Iterator<Item = &'a Self::Element>;
type Intersection: Iterator<Item = &'a Self::Element>;
type SymmetricDifference: Iterator<Item = &'a Self::Element>;
type Union: Iterator<Item = &'a Self::Element>;
Show 30 methods
// Required methods
fn new() -> Self;
fn capacity(&self) -> usize;
fn clear(&mut self);
fn contains(&self, value: &Self::Element) -> bool;
fn difference(&'a self, other: &'a Self) -> Self::Difference;
fn difference_ref(&'a self, other: &'a Self) -> Self::Difference;
fn insert(&mut self, value: Self::Element);
fn intersection(&'a self, other: &'a Self) -> Self::Intersection;
fn is_empty(&self) -> bool;
fn iter(&'a self) -> Self::Iter;
fn len(&self) -> usize;
fn remove(&mut self, value: &Self::Element);
fn retain<F>(&mut self, f: F)
where F: FnMut(&Self::Element) -> bool;
fn symmetric_difference(
&'a self,
other: &'a Self,
) -> Self::SymmetricDifference;
fn symmetric_difference_update(&mut self, rhs: &Self);
fn union(&'a self, other: &'a Self) -> Self::Union;
fn union_update(&mut self, rhs: &Self);
fn with_capacity(capacity: usize) -> Self;
// Provided methods
fn intersection_update(&mut self, rhs: &Self) { ... }
fn intersection_item_update(&mut self, value: &Self::Element) { ... }
fn symmetric_difference_item_update(&mut self, value: &Self::Element) { ... }
fn union_item_update(&mut self, value: &Self::Element) { ... }
fn bitand_assign_set(&mut self, rhs: &Self) { ... }
fn bitand_assign_item(&mut self, rhs: &Self::Element) { ... }
fn bitor_assign_set(&mut self, rhs: &Self) { ... }
fn bitor_assign_item(&mut self, rhs: &Self::Element) { ... }
fn bitxor_assign_set(&mut self, rhs: &Self) { ... }
fn bitxor_assign_item(&mut self, rhs: &Self::Element) { ... }
fn sub_assign_set(&mut self, rhs: &Self) { ... }
fn sub_assign_item(&mut self, rhs: &Self::Element) { ... }
}Required Associated Types§
type Element: Element + 'a
type Iter: Iterator<Item = &'a Self::Element>
type Difference: Iterator<Item = &'a Self::Element>
type Intersection: Iterator<Item = &'a Self::Element>
type SymmetricDifference: Iterator<Item = &'a Self::Element>
type Union: Iterator<Item = &'a Self::Element>
Required Methods§
fn new() -> Self
fn capacity(&self) -> usize
fn clear(&mut self)
fn contains(&self, value: &Self::Element) -> bool
Sourcefn difference(&'a self, other: &'a Self) -> Self::Difference
fn difference(&'a self, other: &'a Self) -> Self::Difference
Returns an iterator of elements representing the difference between this set and another,
i.e., the elements that are in self but not in other.
fn difference_ref(&'a self, other: &'a Self) -> Self::Difference
fn insert(&mut self, value: Self::Element)
fn intersection(&'a self, other: &'a Self) -> Self::Intersection
fn is_empty(&self) -> bool
fn iter(&'a self) -> Self::Iter
fn len(&self) -> usize
fn remove(&mut self, value: &Self::Element)
fn retain<F>(&mut self, f: F)
fn symmetric_difference(&'a self, other: &'a Self) -> Self::SymmetricDifference
fn symmetric_difference_update(&mut self, rhs: &Self)
fn union(&'a self, other: &'a Self) -> Self::Union
fn union_update(&mut self, rhs: &Self)
fn with_capacity(capacity: usize) -> Self
Provided Methods§
fn intersection_update(&mut self, rhs: &Self)
fn intersection_item_update(&mut self, value: &Self::Element)
fn symmetric_difference_item_update(&mut self, value: &Self::Element)
fn union_item_update(&mut self, value: &Self::Element)
fn bitand_assign_set(&mut self, rhs: &Self)
fn bitand_assign_item(&mut self, rhs: &Self::Element)
fn bitor_assign_set(&mut self, rhs: &Self)
fn bitor_assign_item(&mut self, rhs: &Self::Element)
fn bitxor_assign_set(&mut self, rhs: &Self)
fn bitxor_assign_item(&mut self, rhs: &Self::Element)
fn sub_assign_set(&mut self, rhs: &Self)
fn sub_assign_item(&mut self, rhs: &Self::Element)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.