pub struct RegistOrderMap<K, V> { /* private fields */ }Expand description
An RegistOrderMap is like a std::collections::HashMap,
but it is sorted according to the key in descending order.
The RegistOrderMap is a HashMap with guaranteed registration order.
I have only implemented the minimum required methods, so please request them if you have any requests.
Implementations§
Source§impl<K, V> RegistOrderMap<K, V>
impl<K, V> RegistOrderMap<K, V>
Sourcepub fn get(&self, k: &K) -> Option<&V>where
K: Eq,
pub fn get(&self, k: &K) -> Option<&V>where
K: Eq,
Returns a ref2erence to the value corresponding to the key.
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
An iterator visiting all key-value pairs in arbitrary order. The iterator element type is (&'a K, &'a V).
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty RegistOrderMap with at least the specified capacity.
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for RegistOrderMap<K, V>
impl<K: Clone, V: Clone> Clone for RegistOrderMap<K, V>
Source§fn clone(&self) -> RegistOrderMap<K, V>
fn clone(&self) -> RegistOrderMap<K, V>
Returns a duplicate of the value. Read more
1.0.0 · 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> Default for RegistOrderMap<K, V>
impl<K, V> Default for RegistOrderMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for RegistOrderMap<K, V>
impl<K, V> RefUnwindSafe for RegistOrderMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for RegistOrderMap<K, V>
impl<K, V> Sync for RegistOrderMap<K, V>
impl<K, V> Unpin for RegistOrderMap<K, V>
impl<K, V> UnwindSafe for RegistOrderMap<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