Struct extra::treemap::TreeSet

pub struct TreeSet<T> {
    priv map: TreeMap<T, ()>,
}

A implementation of the Set trait on top of the TreeMap container. The only requirement is that the type of the elements contained ascribes to the TotalOrd trait.

Methods

impl<T: std::cmp::TotalOrd> TreeSet<T>

fn new() -> TreeSet<T>

Create an empty TreeSet

fn iter<'a>(&'a self) -> TreeSetIterator<'a, T>

Get a lazy iterator over the values in the set. Requires that it be frozen (immutable).

fn rev_iter<'a>(&'a self) -> TreeSetRevIterator<'a, T>

Get a lazy iterator over the values in the set. Requires that it be frozen (immutable).

fn lower_bound_iter<'a>(&'a self, v: &T) -> TreeSetIterator<'a, T>

Get a lazy iterator pointing to the first value not less than v (greater or equal). If all elements in the set are less than v empty iterator is returned.

fn upper_bound_iter<'a>(&'a self, v: &T) -> TreeSetIterator<'a, T>

Get a lazy iterator pointing to the first value greater than v. If all elements in the set are not greater than v empty iterator is returned.

fn difference<'a>(&'a self, other: &'a TreeSet<T>) -> Difference<'a, T>

Visit the values (in-order) representing the difference

fn symmetric_difference<'a>(&'a self, other: &'a TreeSet<T>) -> SymDifference<'a, T>

Visit the values (in-order) representing the symmetric difference

fn intersection<'a>(&'a self, other: &'a TreeSet<T>) -> Intersection<'a, T>

Visit the values (in-order) representing the intersection

fn union<'a>(&'a self, other: &'a TreeSet<T>) -> Union<'a, T>

Visit the values (in-order) representing the union

Trait Implementations

impl<T: std::cmp::Eq + std::cmp::TotalOrd> std::cmp::Eq for TreeSet<T>

fn eq(&self, other: &TreeSet<T>) -> bool

fn ne(&self, other: &TreeSet<T>) -> bool

impl<T: std::cmp::Ord + std::cmp::TotalOrd> std::cmp::Ord for TreeSet<T>

fn lt(&self, other: &TreeSet<T>) -> bool

fn le(&self, other: &TreeSet<T>) -> bool

fn ge(&self, other: &TreeSet<T>) -> bool

fn gt(&self, other: &TreeSet<T>) -> bool

impl<T: std::cmp::TotalOrd> std::container::Container for TreeSet<T>

fn len(&self) -> uint

Return the number of elements in the set

fn is_empty(&self) -> bool

Return true if the set contains no elements

impl<T: std::cmp::TotalOrd> std::container::Mutable for TreeSet<T>

fn clear(&mut self)

Clear the set, removing all values.

impl<T: std::cmp::TotalOrd> std::container::Set for TreeSet<T>

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

Return true if the set contains a value

fn is_disjoint(&self, other: &TreeSet<T>) -> bool

Return true if the set has no elements in common with other. This is equivalent to checking for an empty intersection.

fn is_subset(&self, other: &TreeSet<T>) -> bool

Return true if the set is a subset of another

fn is_superset(&self, other: &TreeSet<T>) -> bool

Return true if the set is a superset of another

impl<T: std::cmp::TotalOrd> std::container::MutableSet for TreeSet<T>

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

Add a value to the set. Return true if the value was not already present in the set.

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

Remove a value from the set. Return true if the value was present in the set.

impl<T: std::cmp::TotalOrd> std::iter::FromIterator for TreeSet<T>

fn from_iterator<Iter: std::iter::Iterator>(iter: &mut Iter) -> TreeSet<T>

impl<T: std::cmp::TotalOrd> std::iter::Extendable for TreeSet<T>

fn extend<Iter: std::iter::Iterator>(&mut self, iter: &mut Iter)

impl<S: Encoder, T: Encodable<S> + std::cmp::Eq + std::cmp::TotalOrd> Encodable<S> for TreeSet<T>

fn encode(&self, s: &mut S)

impl<D: Decoder, T: Decodable<D> + std::cmp::Eq + std::cmp::TotalOrd> Decodable<D> for TreeSet<T>

fn decode(d: &mut D) -> TreeSet<T>