rust(#rustc 1.72.0 (5680fa18f 2023-08-23)ՆQ4-46a989d0e2cef827e$ɛDp>-b114db70ea0690b1rustc_std_workspace_core ūu sR-13da980d6c74fec5U EquivalentK equivalent Q   Comparable  compare77 7 77777       !  ! W    keyW   SLess~Greater0^  S aI [`Equivalent`] and [`Comparable`] are traits for key comparison in maps.LMJ These may be used in the implementation of maps where the lookup type `Q`QM/ may be different than the stored key type `K`.2I * `Q: Equivalent` checks for equality, similar to the `HashMap`L$ constraint `K: Borrow, Q: Eq`.'J * `Q: Comparable` checks the ordering, similar to the `BTreeMap`M% constraint `K: Borrow, Q: Ord`.(L These traits are not used by the maps in the standard library, but they mayOG add more flexibility in third-party map implementations, especially inJH situations where a strict `K: Borrow` relationship is not available.K # Examples ``` use equivalent::*; use std::cmp::Ordering;% pub struct Pair(pub A, pub B);(O impl<'a, A: ?Sized, B: ?Sized, C, D> Equivalent<(C, D)> for Pair<&'a A, &'a B>R where  A: Equivalent, B: Equivalent, {1 fn equivalent(&self, key: &(C, D)) -> bool {4? self.0.equivalent(&key.0) && self.1.equivalent(&key.1)B }  }O impl<'a, A: ?Sized, B: ?Sized, C, D> Comparable<(C, D)> for Pair<&'a A, &'a B>R  A: Comparable,  B: Comparable,  2 fn compare(&self, key: &(C, D)) -> Ordering { 5' match self.0.compare(&key.0) { *7 Ordering::Equal => self.1.compare(&key.1), :$ not_equal => not_equal, ' }     fn main() { : let key = (String::from("foo"), String::from("bar")); =! let q1 = Pair("foo", "bar"); $! let q2 = Pair("boo", "bar"); $! let q3 = Pair("foo", "baz"); $ " assert!(q1.equivalent(&key)); %# assert!(!q2.equivalent(&key)); &# assert!(!q3.equivalent(&key)); &3 assert_eq!(q1.compare(&key), Ordering::Equal);62 assert_eq!(q2.compare(&key), Ordering::Less);55 assert_eq!(q3.compare(&key), Ordering::Greater);8  a Key equivalence trait.I This trait allows hash table lookup to be customized. It has one blanketLK implementation that uses the regular solution with `Borrow` and `Eq`, justNK like `HashMap` does, so that you can pass `&str` to lookup into a map withN `String` keys and so on. # Contract; The implementor **must** hash like `K`, if it is hashable.> &; Compare self to `key` and return `true` if they are equal.> 77 7 7 #.     % 77 7 7  . Key ordering trait.J This trait allows ordered map lookup to be customized. It has one blanketML implementation that uses the regular solution with `Borrow` and `Ord`, justOL like `BTreeMap` does, so that you can pass `&str` to lookup into a map withO   # ( '1 Compare self to `key` and return their ordering.477 7# 7  #.$ &77 7 7  fHnݐ?uXOfHnݐRbfHnݐ~4ޙ`-rfHnݐbu5 fHnݐAd36fHnݐ7, zfHnݐFvdLfHnݐ(_RfHnݐ;_zZfHnݐ LN)fHnݐ@9/fHnݐ^3*ϯ='SfHnݐ?,5RfHnݐZ=fHnݐ`/fHnݐIgfHnݐJsYCfHnݐQE/fHnݐW"1^cfHnݐfoZfHnݐ$fHnݐXz7 fHnݐ]>_cYfHnݐ &)kOfHnݐ?˲i=fHnݐJOj;fHnݐLPW^ekqw}fHnݐjKb!-!%!5!V!F!j! ODHT @fHnݐRbfHnݐ?˲i=fHnݐXz7 fHnݐ LN) fHnݐ?uXOfHnݐ$fHnݐW"1^cfHnݐbu5 fHnݐQE/fHnݐJOj;fHnݐAd36fHnݐ`/fHnݐIgfHnݐfoZfHnݐ]>_cYfHnݐ~4ޙ`-rfHnݐ7, zfHnݐ;_zZfHnݐ &)kOfHnݐ^WfHnݐ^3*ϯ='S fHnݐJsYCfHnݐ@9/ fHnݐ~qMN3M(N)PKL)S 5C S 6+;( >%%%&''769 MOO?"C+/ ,*NPP19,/ -%}x[*% 'x86_64-unknown-linux-gnucͅ)--7257265f83ae57dafHnݐO(ppPpPpppPPP8P8PPPPPDPDLPLPPPPP88DDpp ]