[−][src]Struct ordered_map::OrderedMap
An OrderedMap is like a std::collections::HashMap,
but it is sorted according to the value in descending order.
It doesn't require the value of the map, V, to be comparable,
the comparision of the value is done on C,
which is the return value of extract_comparable(&V).
Methods
impl<'a, K: 'a, V: 'a, C: 'a> OrderedMap<K, V, C> where
K: Eq + Hash + Copy,
C: PartialOrd, [src]
K: Eq + Hash + Copy,
C: PartialOrd,
pub fn new(extract_comparable: fn(_: &V) -> C) -> Self[src]
The function extract_comparable is used to convert the value of type &V
to something comparable of type C
pub fn len(&self) -> usize[src]
pub fn descending_keys(&'a self) -> DescendingKeys<'a, K, C>[src]
Keys of this map in descending order
pub fn descending_values(&'a self) -> DescendingValues<'a, K, V, C>[src]
Values of this map in descending order
pub fn descending_items(&'a self) -> DescendingItems<'a, K, V, C>[src]
(K, V) pairs of this map in descending order
pub fn insert(&mut self, k: K, v: V) -> Option<V>[src]
Insert a new key-value pair to the map,
the old value is returned as Option<V>
pub fn remove(&mut self, k: &K) -> Option<V>[src]
Remove a key-value pair from the map
Auto Trait Implementations
impl<K, V, C> RefUnwindSafe for OrderedMap<K, V, C> where
C: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
C: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, C> Send for OrderedMap<K, V, C> where
C: Send,
K: Send,
V: Send,
C: Send,
K: Send,
V: Send,
impl<K, V, C> Sync for OrderedMap<K, V, C> where
C: Sync,
K: Sync,
V: Sync,
C: Sync,
K: Sync,
V: Sync,
impl<K, V, C> Unpin for OrderedMap<K, V, C> where
C: Unpin,
K: Unpin,
V: Unpin,
C: Unpin,
K: Unpin,
V: Unpin,
impl<K, V, C> UnwindSafe for OrderedMap<K, V, C> where
C: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
C: 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> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,