AbstractVecSet

Trait AbstractVecSet 

Source
pub trait AbstractVecSet<T: Ord> {
    // Required method
    fn as_slice(&self) -> &[T];

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn contains(&self, value: &T) -> bool { ... }
    fn is_disjoint(&self, that: &impl AbstractVecSet<T>) -> bool { ... }
    fn is_subset(&self, that: &impl AbstractVecSet<T>) -> bool { ... }
    fn is_superset(&self, that: &impl AbstractVecSet<T>) -> bool { ... }
    fn union<A: Array<Item = T>>(
        &self,
        that: &impl AbstractVecSet<T>,
    ) -> VecSet<A>
       where T: Clone { ... }
    fn intersection<A: Array<Item = T>>(
        &self,
        that: &impl AbstractVecSet<T>,
    ) -> VecSet<A>
       where T: Clone { ... }
    fn symmetric_difference<A: Array<Item = T>>(
        &self,
        that: &impl AbstractVecSet<T>,
    ) -> VecSet<A>
       where T: Clone { ... }
    fn difference<A: Array<Item = T>>(
        &self,
        that: &impl AbstractVecSet<T>,
    ) -> VecSet<A>
       where T: Clone { ... }
    fn iter(&self) -> VecSetIter<Iter<'_, T>>  { ... }
}
Expand description

An abstract vec set

this is implemented by VecSet and ArchivedVecSet, so they are interoperable.

Required Methods§

Source

fn as_slice(&self) -> &[T]

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

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

Source

fn is_disjoint(&self, that: &impl AbstractVecSet<T>) -> bool

true if this set has no common elements with another set.

Source

fn is_subset(&self, that: &impl AbstractVecSet<T>) -> bool

true if this set is a subset of another set.

A set is considered to be a subset of itself.

Source

fn is_superset(&self, that: &impl AbstractVecSet<T>) -> bool

true if this set is a superset of another set.

A set is considered to be a superset of itself.

Source

fn union<A: Array<Item = T>>(&self, that: &impl AbstractVecSet<T>) -> VecSet<A>
where T: Clone,

Source

fn intersection<A: Array<Item = T>>( &self, that: &impl AbstractVecSet<T>, ) -> VecSet<A>
where T: Clone,

Source

fn symmetric_difference<A: Array<Item = T>>( &self, that: &impl AbstractVecSet<T>, ) -> VecSet<A>
where T: Clone,

Source

fn difference<A: Array<Item = T>>( &self, that: &impl AbstractVecSet<T>, ) -> VecSet<A>
where T: Clone,

Source

fn iter(&self) -> VecSetIter<Iter<'_, T>>

An iterator that returns references to the items of this set in sorted order

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: Array> AbstractVecSet<<A as Array>::Item> for VecSet<A>
where A::Item: Ord,