pub struct EnumMap<E, V>where
E: PlainEnum,{ /* private fields */ }
Implementations§
Source§impl<E, V> EnumMap<E, V>where
E: PlainEnum,
impl<E, V> EnumMap<E, V>where
E: PlainEnum,
Sourcepub fn from_raw(a: E::EnumMapArray<V>) -> Self
pub fn from_raw(a: E::EnumMapArray<V>) -> Self
Constructs an EnumMap
from the underlying array type.
pub fn from_tuple( tpl: <E::EnumMapArray<V> as TArrayFromFn<V>>::TupleType, ) -> Self
Sourcepub fn iter(&self) -> Iter<'_, V>
pub fn iter(&self) -> Iter<'_, V>
Returns an iterator over the values of the EnumMap. (Similar to an iterator over a slice.)
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, V>
pub fn iter_mut(&mut self) -> IterMut<'_, V>
Returns an iterator over the mutable values of the EnumMap. (Similar to an iterator over a slice.)
Sourcepub fn map<FnMap, W>(&self, fn_map: FnMap) -> EnumMap<E, W>
pub fn map<FnMap, W>(&self, fn_map: FnMap) -> EnumMap<E, W>
Maps the values in a map. (Similar to Iterator::map
.)
Sourcepub fn map_into<FnMap, W>(self, fn_map: FnMap) -> EnumMap<E, W>where
FnMap: Fn(V) -> W,
E: PlainEnum,
<<E as PlainEnum>::EnumMapArray<V> as TArrayMapInto<V>>::MappedType<W>: Into<E::EnumMapArray<W>>,
pub fn map_into<FnMap, W>(self, fn_map: FnMap) -> EnumMap<E, W>where
FnMap: Fn(V) -> W,
E: PlainEnum,
<<E as PlainEnum>::EnumMapArray<V> as TArrayMapInto<V>>::MappedType<W>: Into<E::EnumMapArray<W>>,
Moves and maps the values in a map. (Similar to Iterator::map
.)
Sourcepub fn into_raw(self) -> E::EnumMapArray<V>
pub fn into_raw(self) -> E::EnumMapArray<V>
Consumes an EnumMap
and returns the underlying array.
Sourcepub fn as_raw(&self) -> &E::EnumMapArray<V>
pub fn as_raw(&self) -> &E::EnumMapArray<V>
Exposes a reference to the underlying array.
Sourcepub fn as_raw_mut(&mut self) -> &mut E::EnumMapArray<V>
pub fn as_raw_mut(&mut self) -> &mut E::EnumMapArray<V>
Exposes a mutable reference to the underlying array.
Trait Implementations§
impl<E, V: Copy> Copy for EnumMap<E, V>
impl<E, V: Eq> Eq for EnumMap<E, V>
impl<E, V> StructuralPartialEq for EnumMap<E, V>where
E: PlainEnum,
Auto Trait Implementations§
impl<E, V> Freeze for EnumMap<E, V>
impl<E, V> RefUnwindSafe for EnumMap<E, V>
impl<E, V> Send for EnumMap<E, V>
impl<E, V> Sync for EnumMap<E, V>
impl<E, V> Unpin for EnumMap<E, V>
impl<E, V> UnwindSafe for EnumMap<E, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more