Struct enumoid::EnumMap[][src]

pub struct EnumMap<T: EnumArrayHelper<V>, V> { /* fields omitted */ }

A total map from enumoid T to values V.

Implementations

impl<T: EnumArrayHelper<V>, V: Default> EnumMap<T, V>[src]

pub fn new() -> Self[src]

impl<T: EnumArrayHelper<V>, V> EnumMap<T, V>[src]

pub fn new_with<F>(f: F) -> Self where
    F: FnMut(T) -> V, 
[src]

pub fn as_slice(&self) -> &[V][src]

pub fn as_slice_mut(&mut self) -> &mut [V][src]

pub fn get(&self, key: T) -> &V[src]

pub fn swap(&mut self, a: T, b: T)[src]

pub fn iter(&self) -> EnumSliceIter<'_, T, V>[src]

pub fn iter_mut(&mut self) -> EnumSliceIterMut<'_, T, V>[src]

Trait Implementations

impl<T: EnumArrayHelper<V>, V: Clone> Clone for EnumMap<T, V>[src]

impl<T: EnumArrayHelper<V>, V: Copy> Copy for EnumMap<T, V> where
    T::TotalArray: Copy
[src]

impl<T: EnumArrayHelper<V> + Debug, V: Debug> Debug for EnumMap<T, V>[src]

impl<T: EnumArrayHelper<V>, V: Default> Default for EnumMap<T, V>[src]

impl<'de, T: EnumFlagsHelper + EnumArrayHelper<V> + Deserialize<'de>, V: Deserialize<'de>> Deserialize<'de> for EnumMap<T, V>[src]

impl<T: EnumArrayHelper<V>, V> Index<T> for EnumMap<T, V>[src]

type Output = V

The returned type after indexing.

impl<T: EnumArrayHelper<V>, V> IndexMut<T> for EnumMap<T, V>[src]

impl<'a, T: EnumArrayHelper<V>, V> IntoIterator for &'a EnumMap<T, V>[src]

type Item = (T, &'a V)

The type of the elements being iterated over.

type IntoIter = EnumSliceIter<'a, T, V>

Which kind of iterator are we turning this into?

impl<'a, T: EnumArrayHelper<V>, V> IntoIterator for &'a mut EnumMap<T, V>[src]

type Item = (T, &'a mut V)

The type of the elements being iterated over.

type IntoIter = EnumSliceIterMut<'a, T, V>

Which kind of iterator are we turning this into?

impl<T: EnumArrayHelper<V> + Serialize, V: Serialize> Serialize for EnumMap<T, V>[src]

impl<'a, T: EnumFlagsHelper + EnumArrayHelper<V>, V> TryFrom<EnumOptionMap<T, V>> for EnumMap<T, V>[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T, V> RefUnwindSafe for EnumMap<T, V> where
    <T as EnumArrayHelper<V>>::TotalArray: RefUnwindSafe

impl<T, V> Send for EnumMap<T, V> where
    <T as EnumArrayHelper<V>>::TotalArray: Send

impl<T, V> Sync for EnumMap<T, V> where
    <T as EnumArrayHelper<V>>::TotalArray: Sync

impl<T, V> Unpin for EnumMap<T, V> where
    <T as EnumArrayHelper<V>>::TotalArray: Unpin

impl<T, V> UnwindSafe for EnumMap<T, V> where
    <T as EnumArrayHelper<V>>::TotalArray: UnwindSafe

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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.