[−][src]Struct wasmer_runtime_core::structures::Map
Dense item map
Methods
impl<K, V> Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
pub fn new() -> Self
[src]
Creates a new Map
.
pub fn with_capacity(capacity: usize) -> Self
[src]
Creates a new empty Map
with the given capacity.
pub fn clear(&mut self)
[src]
Clears the map. Keeps the allocated memory for future use.
pub fn len(&self) -> usize
[src]
Returns the size of this map.
pub fn is_empty(&self) -> bool
[src]
Returns true if this map is empty.
pub fn push(&mut self, value: V) -> K
[src]
Adds a new value to this map.
pub fn next_index(&self) -> K
[src]
Returns the next index into the map.
pub fn reserve_exact(&mut self, size: usize)
[src]
Reserves the given size.
pub fn into_boxed_map(self) -> BoxedMap<K, V>
[src]
Convert this into a BoxedMap
.
pub fn into_vec(self) -> Vec<V>
[src]
Convert this into a Vec
.
impl<K, V> Map<K, V> where
K: TypedIndex,
V: Clone,
[src]
K: TypedIndex,
V: Clone,
pub fn resize(&mut self, new_len: usize, value: V)
[src]
Resize this map to the given new length and value.
Methods from Deref<Target = SliceMap<K, V>>
pub fn get(&self, index: K) -> Option<&V>
[src]
Gets a reference to the value at the given index.
pub fn get_mut(&mut self, index: K) -> Option<&mut V>
[src]
Gets a mutable reference to the value at the given index.
pub fn len(&self) -> usize
[src]
Gets the length of this slice map.
ⓘImportant traits for Iter<'a, K, V>pub fn iter(&self) -> Iter<K, V>
[src]
Returns an iterator for this slice map.
ⓘImportant traits for IterMut<'a, K, V>pub fn iter_mut(&mut self) -> IterMut<K, V>
[src]
Returns a mutable iterator for this slice map.
pub fn as_ptr(&self) -> *const V
[src]
Gets a pointer to the SliceMap
.
pub fn as_mut_ptr(&mut self) -> *mut V
[src]
Gets a mutable pointer to the SliceMap
.
Trait Implementations
impl<K: Clone, V: Clone> Clone for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
impl<K: Debug, V: Debug> Debug for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
impl<K, V> Deref for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
type Target = SliceMap<K, V>
The resulting type after dereferencing.
fn deref(&self) -> &SliceMap<K, V>
[src]
impl<K, V> DerefMut for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
impl<'de, K, V> Deserialize<'de> for Map<K, V> where
K: TypedIndex,
V: Deserialize<'de>,
[src]
K: TypedIndex,
V: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<K, V> Extend<V> for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
fn extend<I: IntoIterator<Item = V>>(&mut self, iter: I)
[src]
impl<K, V> FromIterator<V> for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
[src]
impl<K, V> IntoIterator for Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
type Item = (K, V)
The type of the elements being iterated over.
type IntoIter = IntoIter<K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, K, V> IntoIterator for &'a Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
type Item = (K, &'a V)
The type of the elements being iterated over.
type IntoIter = Iter<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, K, V> IntoIterator for &'a mut Map<K, V> where
K: TypedIndex,
[src]
K: TypedIndex,
type Item = (K, &'a mut V)
The type of the elements being iterated over.
type IntoIter = IterMut<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<K, V> Serialize for Map<K, V> where
K: TypedIndex,
V: Serialize,
[src]
K: TypedIndex,
V: Serialize,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Map<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Map<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Map<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Map<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Map<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,