pub trait SetOps<T> {
    fn reverse(&self) -> Self;
fn nonrepeat(&self) -> Self;
fn infsup(&self) -> MinMax<T>;
fn member(&self, m: T) -> bool;
fn search(&self, m: T) -> Option<usize>;
fn union(&self, s: &Self) -> OrderedSet<T>;
fn intersection(&self, s: &Self) -> OrderedSet<T>;
fn difference(&self, s: &Self) -> OrderedSet<T>; }
Expand description

Common methods for all four of the set structs.

Required methods

reverses the vector of explicit sets and index of indexed sets

Deletes any repetitions

Finds minimum, minimum’s first index, maximum, maximum’s first index

True if m is a member of the set

Search of a set, returns Some(index) of the last item found, or None.

Union of two sets of the same type

Intersection of two sets of the same type

Removing s from self (i.e. self-s)

Implementors

These are generally better than OrderedSet(s) for bulky end types, as there is not so much of moving them around.

For lots of set operations, it is probably better to work in IndexedSet(s) and then only to rank the final result.