MapIter

Trait MapIter 

Source
pub trait MapIter<'a>: HasMapData + Iter<'a> {
    type KeyRef: Ref<'a, Self::Key>;
    type ValueRef: Ref<'a, Self::Value>;
    type IterKeysRef: Iterator<Item = Self::KeyRef>;
    type IterValuesRef: Iterator<Item = Self::ValueRef>;

    // Required methods
    fn keys(&'a self) -> Self::IterKeysRef;
    fn values(&'a self) -> Self::IterValuesRef;
}
Expand description

A trait for map-like collections which can be iterated by references to keys and values.

Required Associated Types§

Source

type KeyRef: Ref<'a, Self::Key>

Type of the references to the keys in the collection.

For more information, see the KeyRef trait.

Source

type ValueRef: Ref<'a, Self::Value>

Type of the references to the values in the collection.

For more information, see the ValueRef trait.

Source

type IterKeysRef: Iterator<Item = Self::KeyRef>

Type of the iterator over references to keys.

Source

type IterValuesRef: Iterator<Item = Self::ValueRef>

Type of the iterator over references to values.

Required Methods§

Source

fn keys(&'a self) -> Self::IterKeysRef

Constructs an iterator over references to the keys in this collection.

Source

fn values(&'a self) -> Self::IterValuesRef

Constructs an iterator over references to the values in this collection.

Implementations on Foreign Types§

Source§

impl<'a, K: 'a + Ord, V: 'a> MapIter<'a> for BTreeMap<K, V>

Source§

type KeyRef = &'a K

Source§

type ValueRef = &'a V

Source§

type IterKeysRef = Keys<'a, K, V>

Source§

type IterValuesRef = Values<'a, K, V>

Source§

fn keys(&'a self) -> Keys<'a, K, V>

Source§

fn values(&'a self) -> Values<'a, K, V>

Source§

impl<'a, K: 'a + Hash + Eq, V: 'a> MapIter<'a> for HashMap<K, V>

Source§

type KeyRef = &'a K

Source§

type ValueRef = &'a V

Source§

type IterKeysRef = Keys<'a, K, V>

Source§

type IterValuesRef = Values<'a, K, V>

Source§

fn keys(&'a self) -> Keys<'a, K, V>

Source§

fn values(&'a self) -> Values<'a, K, V>

Implementors§