pub struct Map<K, V>where
K: TypedIndex,{ /* private fields */ }
Expand description
Dense item map
Implementations§
Source§impl<K, V> Map<K, V>where
K: TypedIndex,
impl<K, V> Map<K, V>where
K: TypedIndex,
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new empty Map
with the given capacity.
Sourcepub fn next_index(&self) -> K
pub fn next_index(&self) -> K
Returns the next index into the map.
Sourcepub fn reserve_exact(&mut self, size: usize)
pub fn reserve_exact(&mut self, size: usize)
Reserves the given size.
Sourcepub fn into_boxed_map(self) -> BoxedMap<K, V>
pub fn into_boxed_map(self) -> BoxedMap<K, V>
Convert this into a BoxedMap
.
Methods from Deref<Target = SliceMap<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 at the given index.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
Returns a mutable iterator for this slice map.
Sourcepub fn as_mut_ptr(&mut self) -> *mut V
pub fn as_mut_ptr(&mut self) -> *mut V
Gets a mutable pointer to the SliceMap
.
Trait Implementations§
Source§impl<K, V> BorshDeserialize for Map<K, V>
impl<K, V> BorshDeserialize for Map<K, V>
Source§impl<K, V> BorshSerialize for Map<K, V>
impl<K, V> BorshSerialize for Map<K, V>
Source§impl<K, V> DerefMut for Map<K, V>where
K: TypedIndex,
impl<K, V> DerefMut for Map<K, V>where
K: TypedIndex,
Source§impl<'de, K, V> Deserialize<'de> for Map<K, V>where
K: TypedIndex,
V: Deserialize<'de>,
impl<'de, K, V> Deserialize<'de> for Map<K, V>where
K: TypedIndex,
V: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K, V> Extend<V> for Map<K, V>where
K: TypedIndex,
impl<K, V> Extend<V> for Map<K, V>where
K: TypedIndex,
Source§fn extend<I: IntoIterator<Item = V>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = V>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V> FromIterator<V> for Map<K, V>where
K: TypedIndex,
impl<K, V> FromIterator<V> for Map<K, V>where
K: TypedIndex,
Source§fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, K, V> IntoIterator for &'a Map<K, V>where
K: TypedIndex,
impl<'a, K, V> IntoIterator for &'a Map<K, V>where
K: TypedIndex,
Source§impl<'a, K, V> IntoIterator for &'a mut Map<K, V>where
K: TypedIndex,
impl<'a, K, V> IntoIterator for &'a mut Map<K, V>where
K: TypedIndex,
Source§impl<K, V> IntoIterator for Map<K, V>where
K: TypedIndex,
impl<K, V> IntoIterator for Map<K, V>where
K: TypedIndex,
Auto Trait Implementations§
impl<K, V> Freeze for Map<K, V>
impl<K, V> RefUnwindSafe for Map<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Map<K, V>
impl<K, V> Sync for Map<K, V>
impl<K, V> Unpin for Map<K, V>
impl<K, V> UnwindSafe for Map<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