[][src]Struct enum_map_internals::Iter

pub struct Iter<'a, K, V: 'a> { /* fields omitted */ }

Immutable enum map iterator

This struct is created by iter method or into_iter on a reference to EnumMap.

Examples

use enum_map::{enum_map, Enum};

#[derive(Enum)]
enum Example {
    A,
    B,
    C,
}

fn main() {
    let mut map = enum_map! { Example::A => 3, _ => 0 };
    assert_eq!(map[Example::A], 3);
    for (key, &value) in &map {
        assert_eq!(value, match key {
            Example::A => 3,
            _ => 0,
        });
    }
}

Trait Implementations

impl<'a, K: Debug, V: Debug + 'a> Debug for Iter<'a, K, V>[src]

impl<'a, K: Enum<V>, V> FusedIterator for Iter<'a, K, V>[src]

impl<'a, K: Enum<V>, V> Iterator for Iter<'a, K, V>[src]

type Item = (K, &'a V)

The type of the elements being iterated over.

impl<'a, K: Enum<V>, V> DoubleEndedIterator for Iter<'a, K, V>[src]

impl<'a, K: Enum<V>, V> ExactSizeIterator for Iter<'a, K, V>[src]

Auto Trait Implementations

impl<'a, K, V> Unpin for Iter<'a, K, V>

impl<'a, K, V> Send for Iter<'a, K, V> where
    V: Sync

impl<'a, K, V> Sync for Iter<'a, K, V> where
    V: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]