Struct std::collections::SmallIntMap[src]
pub struct SmallIntMap<T> {
// some fields omitted
}Methods
impl<V> SmallIntMap<V>
fn new<V>() -> SmallIntMap<V>
Create an empty SmallIntMap
fn with_capacity<V>(capacity: uint) -> SmallIntMap<V>
Create an empty SmallIntMap with capacity capacity
fn get<V>(&'a self, key: &uint) -> &'a V
fn iter<V>(&'r self) -> Entries<'r, V>
An iterator visiting all key-value pairs in ascending order by the keys. Iterator element type is (uint, &'r V)
fn mut_iter<V>(&'r mut self) -> MutEntries<'r, V>
An iterator visiting all key-value pairs in ascending order by the keys, with mutable references to the values Iterator element type is (uint, &'r mut V)
fn move_iter<V>(&mut self) -> FilterMap<(uint, Option<V>), (uint, V), Enumerate<MoveItems<Option<V>>>>
Empties the hash map, moving all values into the specified closure
impl<V: Clone> SmallIntMap<V>
fn update_with_key<V: Clone>(&mut self, key: uint, val: V, ff: |uint, V, V| -> V) -> bool
fn update<V: Clone>(&mut self, key: uint, newval: V, ff: |V, V| -> V) -> bool
Trait Implementations
impl<V> Collection for SmallIntMap<V>
fn len<V>(&self) -> uint
Return the number of elements in the map
fn is_empty<V>(&self) -> bool
Return true if there are no elements in the map
fn is_empty<V>(&self) -> bool
impl<V> Mutable for SmallIntMap<V>
fn clear<V>(&mut self)
Clear the map, removing all key-value pairs.
impl<V> Map<uint, V> for SmallIntMap<V>
fn find<V>(&'a self, key: &uint) -> Option<&'a V>
Return a reference to the value corresponding to the key
fn contains_key<V>(&self, &uint) -> bool
impl<V> MutableMap<uint, V> for SmallIntMap<V>
fn find_mut<V>(&'a mut self, key: &uint) -> Option<&'a mut V>
Return a mutable reference to the value corresponding to the key
fn insert<V>(&mut self, key: uint, value: V) -> bool
Insert a key-value pair into the map. An existing value for a key is replaced by the new value. Return true if the key did not already exist in the map.
fn remove<V>(&mut self, key: &uint) -> bool
Remove a key-value pair from the map. Return true if the key was present in the map, otherwise false.
fn swap<V>(&mut self, key: uint, value: V) -> Option<V>
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<V>(&mut self, key: &uint) -> Option<V>
Removes a key from the map, returning the value at the key if the key was previously in the map.