Struct ordered_map::OrderedMap [−][src]
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 comparison of the value is done on C
,
which is the return value of extract_comparable(&V)
.
Implementations
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>ⓘNotable traits for DescendingKeys<'a, K, C>
impl<'a, K: 'a, C: 'a> Iterator for DescendingKeys<'a, K, C> type Item = &'a K;
[src]
Notable traits for DescendingKeys<'a, K, C>
impl<'a, K: 'a, C: 'a> Iterator for DescendingKeys<'a, K, C> type Item = &'a K;
Keys of this map in descending order
pub fn descending_values(&'a self) -> DescendingValues<'a, K, V, C>ⓘNotable traits for DescendingValues<'a, K, V, C>
impl<'a, K, V, C> Iterator for DescendingValues<'a, K, V, C> where
K: Eq + Hash, type Item = &'a V;
[src]
Notable traits for DescendingValues<'a, K, V, C>
impl<'a, K, V, C> Iterator for DescendingValues<'a, K, V, C> where
K: Eq + Hash, type Item = &'a V;
Values of this map in descending order
pub fn descending_items(&'a self) -> DescendingItems<'a, K, V, C>ⓘNotable traits for DescendingItems<'a, K, V, C>
impl<'a, K, V, C> Iterator for DescendingItems<'a, K, V, C> where
K: Eq + Hash, type Item = (&'a K, &'a V);
[src]
Notable traits for DescendingItems<'a, K, V, C>
impl<'a, K, V, C> Iterator for DescendingItems<'a, K, V, C> where
K: Eq + Hash, type Item = (&'a K, &'a V);
(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
Trait Implementations
impl<K: Clone, V: Clone, C: Clone> Clone for OrderedMap<K, V, C>
[src]
fn clone(&self) -> OrderedMap<K, V, C>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K: Debug, V: Debug, C: Debug> Debug for OrderedMap<K, V, C>
[src]
Auto Trait Implementations
impl<K, V, C> RefUnwindSafe for OrderedMap<K, V, C> where
C: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
[src]
C: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, C> Send for OrderedMap<K, V, C> where
C: Send,
K: Send,
V: Send,
[src]
C: Send,
K: Send,
V: Send,
impl<K, V, C> Sync for OrderedMap<K, V, C> where
C: Sync,
K: Sync,
V: Sync,
[src]
C: Sync,
K: Sync,
V: Sync,
impl<K, V, C> Unpin for OrderedMap<K, V, C> where
C: Unpin,
K: Unpin,
V: Unpin,
[src]
C: Unpin,
K: Unpin,
V: Unpin,
impl<K, V, C> UnwindSafe for OrderedMap<K, V, C> where
C: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
[src]
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,