Struct std::collections::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<T: Ord>() -> TreeSet<T>
Create an empty TreeSet
fn iter<T: Ord>(&'a self) -> SetItems<'a, T>
Get a lazy iterator over the values in the set. Requires that it be frozen (immutable).
fn rev_iter<T: Ord>(&'a self) -> RevSetItems<'a, T>
Get a lazy iterator over the values in the set. Requires that it be frozen (immutable).
fn move_iter<T: Ord>(self) -> Map<'static, (T, ()), T, MoveEntries<T, ()>>
Get a lazy iterator that consumes the set.
fn lower_bound<T: Ord>(&'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<T: Ord>(&'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<T: Ord>(&'a self, other: &'a TreeSet<T>) -> DifferenceItems<'a, T>
Visit the values (in-order) representing the difference
fn symmetric_difference<T: Ord>(&'a self, other: &'a TreeSet<T>) -> SymDifferenceItems<'a, T>
Visit the values (in-order) representing the symmetric difference
fn intersection<T: Ord>(&'a self, other: &'a TreeSet<T>) -> IntersectionItems<'a, T>
Visit the values (in-order) representing the intersection
fn union<T: Ord>(&'a self, other: &'a TreeSet<T>) -> UnionItems<'a, T>
Visit the values (in-order) representing the union