Struct std::collections::TreeMap[src]

pub struct TreeMap<K, V> {
    // some fields omitted
}

Methods

impl<K: Ord, V> TreeMap<K, V>

fn new<K: Ord, V>() -> TreeMap<K, V>

Create an empty TreeMap

fn iter<K: Ord, V>(&'a self) -> Entries<'a, K, V>

Get a lazy iterator over the key-value pairs in the map. Requires that it be frozen (immutable).

fn rev_iter<K: Ord, V>(&'a self) -> RevEntries<'a, K, V>

Get a lazy reverse iterator over the key-value pairs in the map. Requires that it be frozen (immutable).

fn mut_iter<K: Ord, V>(&'a mut self) -> MutEntries<'a, K, V>

Get a lazy forward iterator over the key-value pairs in the map, with the values being mutable.

fn mut_rev_iter<K: Ord, V>(&'a mut self) -> RevMutEntries<'a, K, V>

Get a lazy reverse iterator over the key-value pairs in the map, with the values being mutable.

fn move_iter<K: Ord, V>(self) -> MoveEntries<K, V>

Get a lazy iterator that consumes the treemap.

impl<K: Ord, V> TreeMap<K, V>

fn lower_bound<K: Ord, V>(&'a self, k: &K) -> Entries<'a, K, V>

Return a lazy iterator to the first key-value pair whose key is not less than k If all keys in map are less than k an empty iterator is returned.

fn upper_bound<K: Ord, V>(&'a self, k: &K) -> Entries<'a, K, V>

Return a lazy iterator to the first key-value pair whose key is greater than k If all keys in map are not greater than k an empty iterator is returned.

fn mut_lower_bound<K: Ord, V>(&'a mut self, k: &K) -> MutEntries<'a, K, V>

Return a lazy value iterator to the first key-value pair (with the value being mutable) whose key is not less than k.

If all keys in map are less than k an empty iterator is returned.

fn mut_upper_bound<K: Ord, V>(&'a mut self, k: &K) -> MutEntries<'a, K, V>

Return a lazy iterator to the first key-value pair (with the value being mutable) whose key is greater than k.

If all keys in map are not greater than k an empty iterator is returned.

Trait Implementations

impl<K: PartialEq + Ord, V: PartialEq> PartialEq for TreeMap<K, V>

fn eq<K: PartialEq + Ord, V: PartialEq>(&self, other: &TreeMap<K, V>) -> bool

fn ne<K: PartialEq + Ord, V: PartialEq>(&self, &TreeMap<K, V>) -> bool

impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for TreeMap<K, V>

fn lt<K: PartialOrd + Ord, V: PartialOrd>(&self, other: &TreeMap<K, V>) -> bool

fn le<K: PartialOrd + Ord, V: PartialOrd>(&self, &TreeMap<K, V>) -> bool

fn gt<K: PartialOrd + Ord, V: PartialOrd>(&self, &TreeMap<K, V>) -> bool

fn ge<K: PartialOrd + Ord, V: PartialOrd>(&self, &TreeMap<K, V>) -> bool

impl<K: Ord + Show, V: Show> Show for TreeMap<K, V>

fn fmt<K: Ord + Show, V: Show>(&self, f: &mut Formatter) -> Result<(), FormatError>

impl<K: Ord, V> Collection for TreeMap<K, V>

fn len<K: Ord, V>(&self) -> uint

fn is_empty<K: Ord, V>(&self) -> bool

impl<K: Ord, V> Mutable for TreeMap<K, V>

fn clear<K: Ord, V>(&mut self)

impl<K: Ord, V> Map<K, V> for TreeMap<K, V>

fn find<K: Ord, V>(&'a self, key: &K) -> Option<&'a V>

fn contains_key<K: Ord, V>(&self, &K) -> bool

impl<K: Ord, V> MutableMap<K, V> for TreeMap<K, V>

fn find_mut<K: Ord, V>(&'a mut self, key: &K) -> Option<&'a mut V>

fn swap<K: Ord, V>(&mut self, key: K, value: V) -> Option<V>

fn pop<K: Ord, V>(&mut self, key: &K) -> Option<V>

fn insert<K: Ord, V>(&mut self, K, V) -> bool

fn remove<K: Ord, V>(&mut self, &K) -> bool

impl<K: Ord, V> Default for TreeMap<K, V>

fn default<K: Ord, V>() -> TreeMap<K, V>

impl<K: Ord, V> FromIterator<(K, V)> for TreeMap<K, V>

fn from_iter<T: Iterator<(K, V)>>(iter: T) -> TreeMap<K, V>

impl<K: Ord, V> Extendable<(K, V)> for TreeMap<K, V>

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

Derived Implementations

impl<K: Clone, V: Clone> Clone for TreeMap<K, V>

fn clone<K: Clone, V: Clone>(&self) -> TreeMap<K, V>

fn clone_from<K: Clone, V: Clone>(&mut self, &TreeMap<K, V>)