pub struct InsertionOrderedMap<K, V>{ /* private fields */ }Implementations§
Source§impl<K, V> InsertionOrderedMap<K, V>
impl<K, V> InsertionOrderedMap<K, V>
pub fn new() -> Self
pub fn insert(&mut self, k: K, v: V)
pub fn clear(&mut self)
pub fn size(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, k: &K) -> bool
pub fn get(&self, k: &K) -> Option<&V>
pub fn get_mut(&mut self, k: &K) -> Option<&mut V>
Sourcepub fn get_or_default(&mut self, k: K) -> &mut Vwhere
V: Default,
pub fn get_or_default(&mut self, k: K) -> &mut Vwhere
V: Default,
C++ operator[]: returns the value for k, default-inserting it at
the back if absent.
Sourcepub fn find(&self, k: &K) -> Option<usize>
pub fn find(&self, k: &K) -> Option<usize>
C++ find: position of k in insertion order, or None (end()).
Sourcepub fn erase(&mut self, k: &K)
pub fn erase(&mut self, k: &K)
C++ erase(find(k)): removes the pair and shifts every later index
down by one. Absent keys are a no-op (erasing end()).
pub fn iter(&self) -> Iter<'_, (K, V)> ⓘ
Trait Implementations§
Source§impl<K, V: Clone> Clone for InsertionOrderedMap<K, V>
impl<K, V: Clone> Clone for InsertionOrderedMap<K, V>
Source§fn clone(&self) -> InsertionOrderedMap<K, V>
fn clone(&self) -> InsertionOrderedMap<K, V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V: Debug> Debug for InsertionOrderedMap<K, V>
impl<K, V: Debug> Debug for InsertionOrderedMap<K, V>
Source§impl<K, V> Default for InsertionOrderedMap<K, V>
impl<K, V> Default for InsertionOrderedMap<K, V>
Source§impl<'a, K, V> IntoIterator for &'a InsertionOrderedMap<K, V>
impl<'a, K, V> IntoIterator for &'a InsertionOrderedMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for InsertionOrderedMap<K, V>
impl<K, V> RefUnwindSafe for InsertionOrderedMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for InsertionOrderedMap<K, V>
impl<K, V> Sync for InsertionOrderedMap<K, V>
impl<K, V> Unpin for InsertionOrderedMap<K, V>
impl<K, V> UnsafeUnpin for InsertionOrderedMap<K, V>
impl<K, V> UnwindSafe for InsertionOrderedMap<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