Trait collections_rs::Map [] [src]

pub trait Map<'m, K: 'm, V: 'm> {
    type Keys: Iterator<Item = &'m K>;
    type Values: Iterator<Item = &'m V>;
    type ValuesMut: Iterator<Item = &'m mut V>;
    type Iter: Iterator<Item = (&'m K, &'m V)>;
    type IterMut: Iterator<Item = (&'m K, &'m mut V)>;
    fn keys(&'m self) -> Self::Keys;
fn values(&'m self) -> Self::Values;
fn values_mut(&'m mut self) -> Self::ValuesMut;
fn iter(&'m self) -> Self::Iter;
fn iter_mut(&'m mut self) -> Self::IterMut;
fn get(&'m self, key: &K) -> Option<&'m V>;
fn get_mut(&'m mut self, key: &K) -> Option<&'m mut V>;
fn insert(&'m mut self, key: K, value: V) -> Option<(K, V)>;
fn remove(&'m mut self, key: &K) -> Option<(K, V)>; fn contains_key(&'m self, key: &K) -> bool { ... } }

A map associating keys with values.

Associated Types

Required Methods

Returns an iterator over all keys in this Map.

Returns an iterator over all values in this Map.

Returns an iterator over mutable borrows to all values in this Map.

Returns an iterator over all keys and their values in this Map.

Returns an iterator over all keys and their values as mutable borrows.

Borrows value from its key.

Borrows a value mutably from its key.

Inserts a value into this Map. If the key was already used, it returns the old key and value pair.

Removes a value from this Map, returning it.

Provided Methods

Checks whether this Map contains a value at the key.

Implementors