pub struct ArrayMap<K: Eq, V: Sized + PartialEq, const LENGTH: usize> { /* private fields */ }Implementations§
Source§impl<K: Eq, V: Sized + PartialEq, const LENGTH: usize> ArrayMap<K, V, LENGTH>
impl<K: Eq, V: Sized + PartialEq, const LENGTH: usize> ArrayMap<K, V, LENGTH>
Sourcepub const unsafe fn from_array_unchecked(
array: [(K, V); LENGTH],
) -> ArrayMap<K, V, LENGTH>
pub const unsafe fn from_array_unchecked( array: [(K, V); LENGTH], ) -> ArrayMap<K, V, LENGTH>
Please only use this method to create map literals if the “macros” feature is unavailable to you “macros” provides safe, checked alternatives to initialize linear maps with compile time checking of the invariants of each type.
Creates a new ArrayMap from the supplied array.
SAFETY: improper use of this method - initializing with duplicate keys -will NOT create memory unsafety, but will result in every identical key beyond the first never getting accessed as LinearMaps short circuit on the first matching key.
Trait Implementations§
Source§impl<K: Clone + Eq, V: Clone + Sized + PartialEq, const LENGTH: usize> Clone for ArrayMap<K, V, LENGTH>
impl<K: Clone + Eq, V: Clone + Sized + PartialEq, const LENGTH: usize> Clone for ArrayMap<K, V, LENGTH>
Source§impl<K: Debug + Eq, V: Debug + Sized + PartialEq, const LENGTH: usize> Debug for ArrayMap<K, V, LENGTH>
impl<K: Debug + Eq, V: Debug + Sized + PartialEq, const LENGTH: usize> Debug for ArrayMap<K, V, LENGTH>
Source§impl<K: Hash + Eq, V: Hash + Sized + PartialEq, const LENGTH: usize> Hash for ArrayMap<K, V, LENGTH>
impl<K: Hash + Eq, V: Hash + Sized + PartialEq, const LENGTH: usize> Hash for ArrayMap<K, V, LENGTH>
Source§impl<K: Eq, V: Sized + PartialEq, const LENGTH: usize> LinearMap<K, V> for ArrayMap<K, V, LENGTH>
impl<K: Eq, V: Sized + PartialEq, const LENGTH: usize> LinearMap<K, V> for ArrayMap<K, V, LENGTH>
type Backing = [(K, V); LENGTH]
Source§fn into_inner(self) -> Self::Backing
fn into_inner(self) -> Self::Backing
Consumes self, returning the underlying store.
Source§fn contains_key(&self, key: &K) -> bool
fn contains_key(&self, key: &K) -> bool
Returns true if this map contains the given key. False otherwise.
Source§fn contains_value(&self, value: &V) -> bool
fn contains_value(&self, value: &V) -> bool
Returns true if this map contains a given value. False otherwise.
Source§fn get<'a>(&'a self, key: &'a K) -> Option<&'a V>
fn get<'a>(&'a self, key: &'a K) -> Option<&'a V>
Gets a reference with the associated key. Will return None if that i
key is not in the map.
Source§fn get_mut<'a>(&'a mut self, key: &'a K) -> Option<&'a mut V>
fn get_mut<'a>(&'a mut self, key: &'a K) -> Option<&'a mut V>
Gets a mutable reference with the associated key. Will return None if that
key is not in the map.
Source§fn nth_value<'a>(&'a self, index: usize) -> Option<&'a V>where
K: 'a,
fn nth_value<'a>(&'a self, index: usize) -> Option<&'a V>where
K: 'a,
Gets a reference to the nth value in the map.
Will return None if index is out of bounds.
Source§fn nth_value_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut V>where
K: 'a,
fn nth_value_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut V>where
K: 'a,
Gets a reference to the nth value in the map.
Will return None if index is out of bounds.
Source§fn nth_key<'a>(&'a self, index: usize) -> Option<&'a K>where
V: 'a,
fn nth_key<'a>(&'a self, index: usize) -> Option<&'a K>where
V: 'a,
Gets a reference to the nth value in the map.
Will return None if index is out of bounds.
Source§fn nth_key_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut K>where
V: 'a,
fn nth_key_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut K>where
V: 'a,
Gets a reference to the nth key in the map.
Will return None if index is out of bounds.
Source§impl<K: Ord + Eq, V: Ord + Sized + PartialEq, const LENGTH: usize> Ord for ArrayMap<K, V, LENGTH>
impl<K: Ord + Eq, V: Ord + Sized + PartialEq, const LENGTH: usize> Ord for ArrayMap<K, V, LENGTH>
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 + Eq, V: PartialEq + Sized + PartialEq, const LENGTH: usize> PartialEq for ArrayMap<K, V, LENGTH>
impl<K: PartialEq + Eq, V: PartialEq + Sized + PartialEq, const LENGTH: usize> PartialEq for ArrayMap<K, V, LENGTH>
Source§impl<K: PartialOrd + Eq, V: PartialOrd + Sized + PartialEq, const LENGTH: usize> PartialOrd for ArrayMap<K, V, LENGTH>
impl<K: PartialOrd + Eq, V: PartialOrd + Sized + PartialEq, const LENGTH: usize> PartialOrd for ArrayMap<K, V, LENGTH>
impl<K: Eq + Eq, V: Eq + Sized + PartialEq, const LENGTH: usize> Eq for ArrayMap<K, V, LENGTH>
impl<K: Eq, V: Sized + PartialEq, const LENGTH: usize> StructuralPartialEq for ArrayMap<K, V, LENGTH>
Auto Trait Implementations§
impl<K, V, const LENGTH: usize> Freeze for ArrayMap<K, V, LENGTH>
impl<K, V, const LENGTH: usize> RefUnwindSafe for ArrayMap<K, V, LENGTH>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, const LENGTH: usize> Send for ArrayMap<K, V, LENGTH>
impl<K, V, const LENGTH: usize> Sync for ArrayMap<K, V, LENGTH>
impl<K, V, const LENGTH: usize> Unpin for ArrayMap<K, V, LENGTH>
impl<K, V, const LENGTH: usize> UnwindSafe for ArrayMap<K, V, LENGTH>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