Set

Trait Set 

Source
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§

Source

type Element: Element + 'a

Source

type Iter: Iterator<Item = &'a Self::Element>

Source

type Difference: Iterator<Item = &'a Self::Element>

Source

type Intersection: Iterator<Item = &'a Self::Element>

Source

type SymmetricDifference: Iterator<Item = &'a Self::Element>

Source

type Union: Iterator<Item = &'a Self::Element>

Required Methods§

Source

fn new() -> Self

Source

fn capacity(&self) -> usize

Source

fn clear(&mut self)

Source

fn contains(&self, value: &Self::Element) -> bool

Source

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.

Source

fn difference_ref(&'a self, other: &'a Self) -> Self::Difference

Source

fn insert(&mut self, value: Self::Element)

Source

fn intersection(&'a self, other: &'a Self) -> Self::Intersection

Source

fn is_empty(&self) -> bool

Source

fn iter(&'a self) -> Self::Iter

Source

fn len(&self) -> usize

Source

fn remove(&mut self, value: &Self::Element)

Source

fn retain<F>(&mut self, f: F)
where F: FnMut(&Self::Element) -> bool,

Source

fn symmetric_difference(&'a self, other: &'a Self) -> Self::SymmetricDifference

Source

fn symmetric_difference_update(&mut self, rhs: &Self)

Source

fn union(&'a self, other: &'a Self) -> Self::Union

Source

fn union_update(&mut self, rhs: &Self)

Source

fn with_capacity(capacity: usize) -> Self

Provided Methods§

Source

fn intersection_update(&mut self, rhs: &Self)

Source

fn intersection_item_update(&mut self, value: &Self::Element)

Source

fn symmetric_difference_item_update(&mut self, value: &Self::Element)

Source

fn union_item_update(&mut self, value: &Self::Element)

Source

fn bitand_assign_set(&mut self, rhs: &Self)

Source

fn bitand_assign_item(&mut self, rhs: &Self::Element)

Source

fn bitor_assign_set(&mut self, rhs: &Self)

Source

fn bitor_assign_item(&mut self, rhs: &Self::Element)

Source

fn bitxor_assign_set(&mut self, rhs: &Self)

Source

fn bitxor_assign_item(&mut self, rhs: &Self::Element)

Source

fn sub_assign_set(&mut self, rhs: &Self)

Source

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.

Implementors§

Source§

impl<'a, E: Element + 'a> Set<'a> for VecSet<E>

Source§

type Element = E

Source§

type Iter = Iter<'a, E>

Source§

type Difference = Difference<'a, E>

Source§

type Intersection = Intersection<'a, E>

Source§

type SymmetricDifference = SymmetricDifference<'a, E>

Source§

type Union = Union<'a, E>