Struct enum_map::Iter[][src]

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,
}

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: Enum<V>, V> Clone for Iter<'a, K, V>[src]

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

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]

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.

Auto Trait Implementations

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

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

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

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

Blanket Implementations

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

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

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

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

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> 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.