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>
source§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>
source§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, V, const N: usize> KeyedRef for ArrayMap<K, V, N>
impl<K, V, const N: usize> KeyedRef for ArrayMap<K, V, N>
source§type KeyRef<'a> = &'a <ArrayMap<K, V, N> as Keyed>::Key
where
Self: 'a
type KeyRef<'a> = &'a <ArrayMap<K, V, N> as Keyed>::Key where Self: 'a
Type of references to keys of the collection.
source§fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
Changes a key reference into a shorter lived reference. Read more
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: 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>
impl<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more