pub struct IndexMap<K: MapIndex, V> { /* private fields */ }
Expand description
It’s an array. Lmao.
Implementations§
Source§impl<V, K: MapIndex> IndexMap<K, V>
impl<V, K: MapIndex> IndexMap<K, V>
Sourcepub fn get_mut(&mut self, index: K) -> Option<&mut V>
pub fn get_mut(&mut self, index: K) -> Option<&mut V>
Gets a mutable reference to the value in slot index
.
Sourcepub fn get_many_mut<const N: usize>(
&mut self,
indices: [K; N],
) -> Result<[&mut V; N], GetManyMutError>
pub fn get_many_mut<const N: usize>( &mut self, indices: [K; N], ) -> Result<[&mut V; N], GetManyMutError>
Returns mutable references to many indices at once.
Returns an error if any index is out of bounds, or if the same index was passed twice.
Sourcepub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>
Returns an iterator that allows modifying each value.
Trait Implementations§
impl<K: Eq + MapIndex, V: Eq> Eq for IndexMap<K, V>
impl<K: MapIndex, V> StructuralPartialEq for IndexMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for IndexMap<K, V>
impl<K, V> RefUnwindSafe for IndexMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for IndexMap<K, V>
impl<K, V> Sync for IndexMap<K, V>
impl<K, V> Unpin for IndexMap<K, V>
impl<K, V> UnwindSafe for IndexMap<K, V>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