Struct lattices::collections::ArrayMap
source · pub struct ArrayMap<K, V, const N: usize> {
pub keys: [K; N],
pub vals: [V; N],
}
Expand description
An array wrapper representing a fixed-size map.
Fields§
§keys: [K; N]
Keys, corresponding 1:1 with vals
.
vals: [V; N]
Values, corresponding 1:1 with keys
.
Trait Implementations§
source§impl<K, V, const N: usize> CollectionMut for ArrayMap<K, V, N>
impl<K, V, const N: usize> CollectionMut for ArrayMap<K, V, N>
§type ItemMut<'a> = &'a mut <ArrayMap<K, V, N> as Collection>::Item
where
Self: 'a
type ItemMut<'a> = &'a mut <ArrayMap<K, V, N> as Collection>::Item where Self: 'a
Type of mutable references to items of the collection.
source§fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>
) -> Self::ItemMut<'short>where
Self: 'long,
fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>
) -> Self::ItemMut<'short>where
Self: 'long,
Changes an item mutable reference into a shorter lived mutable reference. Read more
source§impl<K, V, const N: usize> CollectionRef for ArrayMap<K, V, N>
impl<K, V, const N: usize> CollectionRef for ArrayMap<K, V, N>
§type ItemRef<'a> = &'a <ArrayMap<K, V, N> as Collection>::Item
where
Self: 'a
type ItemRef<'a> = &'a <ArrayMap<K, V, N> as Collection>::Item where Self: 'a
Type of references to items of the collection.
source§fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>
) -> Self::ItemRef<'short>where
Self: 'long,
fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>
) -> Self::ItemRef<'short>where
Self: 'long,
Changes an item reference into a shorter lived reference. Read more
source§impl<'a, Q, K, V, const N: usize> GetKeyValue<&'a Q> for ArrayMap<K, V, N>
impl<'a, Q, K, V, const N: usize> GetKeyValue<&'a Q> for ArrayMap<K, V, N>
source§fn get_key_value(
&self,
key: &'a Q
) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>
fn get_key_value( &self, key: &'a Q ) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>
Returns the key-value pair matching the given
key
.source§impl<'a, Q, K, V, const N: usize> GetKeyValueMut<&'a Q> for ArrayMap<K, V, N>
impl<'a, Q, K, V, const N: usize> GetKeyValueMut<&'a Q> for ArrayMap<K, V, N>
source§fn get_key_value_mut(
&mut self,
key: &'a Q
) -> Option<(Self::KeyRef<'_>, Self::ItemMut<'_>)>
fn get_key_value_mut( &mut self, key: &'a Q ) -> Option<(Self::KeyRef<'_>, Self::ItemMut<'_>)>
Returns the key-value pair matching the given
key
, with a mutable reference to the value.source§impl<K, V, const N: usize> IntoIterator for ArrayMap<K, V, N>
impl<K, V, const N: usize> IntoIterator for ArrayMap<K, V, N>
source§impl<K, OldVal, const N: usize> MapMapValues<OldVal> for ArrayMap<K, OldVal, N>
impl<K, OldVal, const N: usize> MapMapValues<OldVal> for ArrayMap<K, OldVal, N>
source§impl<K: Ord, V: Ord, const N: usize> Ord for ArrayMap<K, V, N>
impl<K: Ord, V: Ord, const N: usize> Ord for ArrayMap<K, V, N>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K: PartialEq, V: PartialEq, const N: usize> PartialEq for ArrayMap<K, V, N>
impl<K: PartialEq, V: PartialEq, const N: usize> PartialEq for ArrayMap<K, V, N>
source§impl<K: PartialOrd, V: PartialOrd, const N: usize> PartialOrd for ArrayMap<K, V, N>
impl<K: PartialOrd, V: PartialOrd, const N: usize> PartialOrd for ArrayMap<K, V, N>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<K: Copy, V: Copy, const N: usize> Copy for ArrayMap<K, V, N>
impl<K: Eq, V: Eq, const N: usize> Eq for ArrayMap<K, V, N>
impl<K, V, const N: usize> StructuralPartialEq for ArrayMap<K, V, N>
Auto Trait Implementations§
impl<K, V, const N: usize> Freeze for ArrayMap<K, V, N>
impl<K, V, const N: usize> RefUnwindSafe for ArrayMap<K, V, N>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, const N: usize> Send for ArrayMap<K, V, N>
impl<K, V, const N: usize> Sync for ArrayMap<K, V, N>
impl<K, V, const N: usize> Unpin for ArrayMap<K, V, N>
impl<K, V, const N: usize> UnwindSafe for ArrayMap<K, V, N>where
K: UnwindSafe,
V: UnwindSafe,
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