Struct collections::treemap::TreeMap[src]

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

Methods

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

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

Create an empty TreeMap

fn iter<'a>(&'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<'a>(&'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<'a>(&'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<'a>(&'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(self) -> MoveEntries<K, V>

Get a lazy iterator that consumes the treemap.

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

fn lower_bound<'a>(&'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<'a>(&'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<'a>(&'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<'a>(&'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(&self, other: &TreeMap<K, V>) -> bool

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

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

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

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

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

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

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

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

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

fn len(&self) -> uint

fn is_empty(&self) -> bool

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

fn clear(&mut self)

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

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

fn contains_key(&self, key: &K) -> bool

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

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

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

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

fn insert(&mut self, key: K, value: V) -> bool

fn remove(&mut self, key: &K) -> bool

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

fn default() -> 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(&self) -> TreeMap<K, V>

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