Trait eclectic::map::Map [] [src]

pub trait Map: Collection<Item=(Self::Key, Self::Value)> {
    type Key;
    type Value;
    fn entry<'a>(&'a mut self, key: Self::Key) -> Entry<'a, Self::Key, Self::Value> where Self: Insert + Remove;
    fn iter<'a>(&'a self) -> Box<Iterator<Item=(&'a Self::Key, &'a Self::Value)> + 'a>;
    fn iter_mut<'a>(&'a mut self) -> Box<Iterator<Item=(&'a Self::Key, &'a mut Self::Value)> + 'a>;
}

A map.

A map is a collection that associates keys with values, where the keys are distinguished according to some uniqueness criteria.

Associated Types

type Key

The type of the map's keys.

type Value

The type of the map's values.

Required Methods

fn entry<'a>(&'a mut self, key: Self::Key) -> Entry<'a, Self::Key, Self::Value> where Self: Insert + Remove

Returns the entry in the map corresponding to the given key.

fn iter<'a>(&'a self) -> Box<Iterator<Item=(&'a Self::Key, &'a Self::Value)> + 'a>

Returns an iterator that yields references to the map's keys and references to their values.

The iteration order is unspecified, but subtraits may place a requirement on it.

fn iter_mut<'a>(&'a mut self) -> Box<Iterator<Item=(&'a Self::Key, &'a mut Self::Value)> + 'a>

Returns an iterator that yields references to the map's keys and mutable references to their values.

The iteration order is unspecified, but subtraits may place a requirement on it.

Implementors