Struct collections::trie::TrieMap
pub struct TrieMap<T> { // some fields omitted }
Methods
impl<T> TrieMap<T>
fn new() -> TrieMap<T>
Create an empty TrieMap
fn each_reverse<'a>(&'a self, f: |&uint, &'a T| -> bool) -> bool
Visit all key-value pairs in reverse order
fn iter<'a>(&'a self) -> Entries<'a, T>
Get an iterator over the key-value pairs in the map
fn mut_iter<'a>(&'a mut self) -> MutEntries<'a, T>
Get an iterator over the key-value pairs in the map, with the ability to mutate the values.
impl<T> TrieMap<T>
fn lower_bound<'a>(&'a self, key: uint) -> Entries<'a, T>
Get an iterator pointing to the first key-value pair whose key is not less than key
.
If all keys in the map are less than key
an empty iterator is returned.
fn upper_bound<'a>(&'a self, key: uint) -> Entries<'a, T>
Get an iterator pointing to the first key-value pair whose key is greater than key
.
If all keys in the map are not greater than key
an empty iterator is returned.
fn mut_lower_bound<'a>(&'a mut self, key: uint) -> MutEntries<'a, T>
Get an iterator pointing to the first key-value pair whose key is not less than key
.
If all keys in the map are less than key
an empty iterator is returned.
fn mut_upper_bound<'a>(&'a mut self, key: uint) -> MutEntries<'a, T>
Get an iterator pointing to the first key-value pair whose key is greater than key
.
If all keys in the map are not greater than key
an empty iterator is returned.
Trait Implementations
impl<T> Container for TrieMap<T>
fn len(&self) -> uint
Return the number of elements in the map
impl<T> Mutable for TrieMap<T>
fn clear(&mut self)
Clear the map, removing all values.
impl<T> Map<uint, T> for TrieMap<T>
fn find<'a>(&'a self, key: &uint) -> Option<&'a T>
Return a reference to the value corresponding to the key
impl<T> MutableMap<uint, T> for TrieMap<T>
fn find_mut<'a>(&'a mut self, key: &uint) -> Option<&'a mut T>
Return a mutable reference to the value corresponding to the key
fn swap(&mut self, key: uint, value: T) -> Option<T>
Insert a key-value pair from the map. If the key already had a value present in the map, that value is returned. Otherwise None is returned.
fn pop(&mut self, key: &uint) -> Option<T>
Removes a key from the map, returning the value at the key if the key was previously in the map.