Trait Comparable

Source
pub trait Comparable<K: ?Sized>: Equivalent<K> {
    // Required method
    fn compare(&self, key: &K) -> Ordering;
}
Expand description

Key ordering trait.

This trait allows ordered map lookup to be customized. It has one blanket implementation that uses the regular solution with Borrow and Ord, just like BTreeMap does, so that you can pass &str to lookup into a map with String keys and so on.

Required Methods§

Source

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.

Implementors§

Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy