pub struct TinySecondaryMap<K: Key, V> { /* private fields */ }Implementations§
Source§impl<K: Key, V> TinySecondaryMap<K, V>
impl<K: Key, V> TinySecondaryMap<K, V>
Sourcepub unsafe fn iter_many_unchecked_mut<'a, I>(
&'a mut self,
keys: I,
) -> IterManyMut<'a, K, V, I::IntoIter> ⓘ
pub unsafe fn iter_many_unchecked_mut<'a, I>( &'a mut self, keys: I, ) -> IterManyMut<'a, K, V, I::IntoIter> ⓘ
Returns an iterator of mutable references to the values corresponding to the keys.
§Safety
The caller must ensure that the keys are valid and unique, otherwise the returned references will UB.
Source§impl<K: Key, V> TinySecondaryMap<K, V>
impl<K: Key, V> TinySecondaryMap<K, V>
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new, empty TinySecondaryMap.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an emtpy TinySecondaryMap with the given capacity.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Inserts or replaces a value into the secondary map at the given key. Returns None if
the key was not present, otherwise returns the previous value.
pub fn extend(&mut self, values: impl IntoIterator<Item = (K, V)>)
pub fn contains_key(&self, key: K) -> bool
Sourcepub fn get(&self, key: K) -> Option<&V>
pub fn get(&self, key: K) -> Option<&V>
Returns a reference to the value corresponding to the key.
Sourcepub fn get_mut(&mut self, key: K) -> Option<&mut V>
pub fn get_mut(&mut self, key: K) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the key.
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> ⓘ
Sourcepub fn keys(&self) -> impl Iterator<Item = K> + '_
pub fn keys(&self) -> impl Iterator<Item = K> + '_
Returns an iterator over the keys in the map.
Sourcepub fn values(&self) -> ValuesIter<'_, V> ⓘ
pub fn values(&self) -> ValuesIter<'_, V> ⓘ
Returns an iterator over the values in the map, ordered by key.
Trait Implementations§
Source§impl<K: Clone + Key, V: Clone> Clone for TinySecondaryMap<K, V>
impl<K: Clone + Key, V: Clone> Clone for TinySecondaryMap<K, V>
Source§fn clone(&self) -> TinySecondaryMap<K, V>
fn clone(&self) -> TinySecondaryMap<K, V>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K: Key, V> Default for TinySecondaryMap<K, V>
impl<K: Key, V> Default for TinySecondaryMap<K, V>
Source§impl<K: Key, V> Extend<(K, V)> for TinySecondaryMap<K, V>
impl<K: Key, V> Extend<(K, V)> for TinySecondaryMap<K, V>
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
§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.
§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: Key, V> FromIterator<(K, V)> for TinySecondaryMap<K, V>
impl<K: Key, V> FromIterator<(K, V)> for TinySecondaryMap<K, V>
Source§impl<K: Key, V> Index<K> for TinySecondaryMap<K, V>
impl<K: Key, V> Index<K> for TinySecondaryMap<K, V>
Source§impl<K: Key, V> IndexMut<K> for TinySecondaryMap<K, V>
impl<K: Key, V> IndexMut<K> for TinySecondaryMap<K, V>
Source§impl<K: Key, V> IntoIterator for TinySecondaryMap<K, V>
impl<K: Key, V> IntoIterator for TinySecondaryMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for TinySecondaryMap<K, V>
impl<K, V> RefUnwindSafe for TinySecondaryMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for TinySecondaryMap<K, V>
impl<K, V> Sync for TinySecondaryMap<K, V>
impl<K, V> Unpin for TinySecondaryMap<K, V>
impl<K, V> UnwindSafe for TinySecondaryMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)