Struct collections::treemap::TreeSet[src]

pub struct TreeSet<T> {
    // some fields omitted
}

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 Ord trait.

Methods

impl<T: Ord> TreeSet<T>

fn new() -> TreeSet<T>

Create an empty TreeSet

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

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

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

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

fn move_iter(self) -> MoveSetItems<T>

Get a lazy iterator that consumes the set.

fn lower_bound<'a>(&'a self, v: &T) -> SetItems<'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<'a>(&'a self, v: &T) -> SetItems<'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>) -> DifferenceItems<'a, T>

Visit the values (in-order) representing the difference

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

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

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

Visit the values (in-order) representing the intersection

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

Visit the values (in-order) representing the union

Trait Implementations

impl<T: PartialEq + Ord> PartialEq for TreeSet<T>

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

fn ne(&self, other: &Self) -> bool

impl<T: PartialOrd + Ord> PartialOrd for TreeSet<T>

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

fn le(&self, other: &Self) -> bool

fn gt(&self, other: &Self) -> bool

fn ge(&self, other: &Self) -> bool

impl<T: Ord + Show> Show for TreeSet<T>

fn fmt(&self, f: &mut Formatter) -> Result

impl<T: Ord> Collection for TreeSet<T>

fn len(&self) -> uint

fn is_empty(&self) -> bool

impl<T: Ord> Mutable for TreeSet<T>

fn clear(&mut self)

impl<T: Ord> Set<T> for TreeSet<T>

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

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

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

fn is_superset(&self, other: &Self) -> bool

impl<T: Ord> MutableSet<T> for TreeSet<T>

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

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

impl<T: Ord> Default for TreeSet<T>

fn default() -> TreeSet<T>

impl<T: Ord> FromIterator<T> for TreeSet<T>

fn from_iter<Iter: Iterator<T>>(iter: Iter) -> TreeSet<T>

impl<T: Ord> Extendable<T> for TreeSet<T>

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

Derived Implementations

impl<T: Clone> Clone for TreeSet<T>

fn clone(&self) -> TreeSet<T>

fn clone_from(&mut self, source: &Self)