Files
guba-indicator/rust/target/debug/deps/libequivalent-e113575d355eefe7.rmeta

16 lines
7.2 KiB
Plaintext
Raw Normal View History

rust
G#rustc 1.93.1 (01f6ddf75 2026-02-11)<29><02><05><11><><EFBFBD>GȬx<C8AC>92X<32>l-5bed970bceb2abc5<63><02>L<><4C><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>E,<07>R<EFBFBD><52>-3d16dd14375d91ab<61><01><02>
Equivalent<EFBFBD>K<>
equivalent<EFBFBD>Q<><01><01>
Comparable<EFBFBD> <01> compare<72><01><01><01>         <01><01> <01><01>  <02>g4<67><01><02>D<>١<04><00><00>LI [`Equivalent`] and [`Comparable`] are traits for key comparison in maps.<2E>M<02><00>QMJ These may be used in the implementation of maps where the lookup type `Q`<60><00><>2/ may be different than the stored key type `K`.<2E><1C><02><00><>LI * `Q: Equivalent<K>` checks for equality, similar to the `HashMap<K, V>`<60><00><>'$ constraint `K: Borrow<Q>, Q: Eq`.<2E><00><>MJ * `Q: Comparable<K>` checks the ordering, similar to the `BTreeMap<K, V>`<60><00><>(% constraint `K: Borrow<Q>, Q: Ord`.<2E><1C><02><00><>OL These traits are not used by the maps in the standard library, but they may<61><00><>JG add more flexibility in third-party map implementations, especially in<69><00><>KH situations where a strict `K: Borrow<Q>` relationship is not available.<2E><1C><02>t<> # Examples<65><1C><02><<3C> ```<60><00><> use equivalent::*;<3B><00><> use std::cmp::Ordering;<3B><1C><02><00><>(% pub struct Pair<A, B>(pub A, pub B);<3B><1C><02><00><>RO impl<'a, A: ?Sized, B: ?Sized, C, D> Equivalent<(C, D)> for Pair<&'a A, &'a B><3E>L<> where<72>̍ A: Equivalent<C>,<2C>̧ B: Equivalent<D>,<2C>,<2C> {<7B><00><>41 fn equivalent(&self, key: &(C, D)) -> bool {<7B><00><>B? self.0.equivalent(&key.0) && self.1.equivalent(&key.1)<29>L<> }<7D>,<2C> }<7D><1C><02><00><>RO impl<'a, A: ?Sized, B: ?Sized, C, D> Comparable<(C, D)> for Pair<&'a A, &'a B><3E>L<> <01> ̰  A: Comparable<C>,<2C><00><>  B: Comparable<D>,<2C>,<2C> <01> <00><> 52 fn compare(&self, key: &(C, D)) -> Ordering {<7B><00><>
*' match self.0.compare(&key.0) {<7B><00><>
:7 Ordering::Equal => self.1.compare(&key.1),<2C><00><> '$ not_equal => not_equal,<2C>l<>
}<7D>L<> <01> ,<2C> <01> <1C> <02>|<7C> fn main() {<7B><00><> =: let key = (String::from("foo"), String::from("bar"));<3B><00><> $! let q1 = Pair("foo", "bar");<3B><00><> $! let q2 = Pair("boo", "bar");<3B><00><> $! let q3 = Pair("foo", "baz");<3B><1C> <02><00><> %" assert!(q1.equivalent(&key));<3B><00><> &# assert!(!q2.equivalent(&key));<3B><00><> &# assert!(!q3.equivalent(&key));<3B><1C><02><00><>63 assert_eq!(q1.compare(&key), Ordering::Equal);<3B><00><>52 assert_eq!(q2.compare(&key), Ordering::Less);<3B><00><>85 assert_eq!(q3.compare(&key), Ordering::Greater);<3B>,<2C><01> <<3C><01>  <02>rg<13><01><02><13>١<04><><13><01><><13><01><><00><> Key equivalence trait.<2E><1C><02><00><>LI This trait allows hash table lookup to be customized. It has one blanket<65><00><>NK implementation that uses the regular solution with `Borrow` and `Eq`, just<73><00><>NK like `HashMap` does, so that you can pass `&str` to lookup into a map with<74><00><> `String` keys and so on.<2E><1C><02>t<> # Contract<63><1C><02><00><>>; The implementor **must** hash like `K`, if it is hashable.<2E>T<><01><01><><00><><12><01><><01> <0C><00>(<00>-$&<00><>&<00><>>; Compare self to `key` and return `true` if they are equal.<2E>T<EFBFBD> <13> <14> <0C> <01><01>$<24>key<65><1C><00><>Q<01> <01>

<01><><01> <0C><00> <0C><01><01><14><01><01><01>L<><00>  79=?<00><>%T<> <15> <16> <0C> <01><01>$<24><01><1C><00><>.<00><> Key ordering trait.<2E><1C><02><00><>MJ This trait allows ordered map lookup to be customized. It has one blanket<65><00><>OL implementation that uses the regular solution with `Borrow` and `Ord`, just<73><00><>OL like `BTreeMap` does, so that you can pass `&str` to lookup into a map with<74><00><><01>T<> <01>   <00><1B><><17><01><01>l<><00> <0C> <00>0<00>""<00>:<00>",.0<00><>'<00><>41 Compare self to `key` and return their ordering.<2E><<3C> <17> <18>١ڡۡLess<73>ܡݡޡ<02>ߡ<01><><01><>Greater<65><01><><00>[1~p<>  <0C> <01><01>$<24><01><1C><00><>R<01><01><00> <0C><00> <0C><01><01><1C><00>L<><00>,.24<00><>&<<3C> <19> <1A><00>$ <0C> <01><01>$<24><01><1C><17>r <0C>r<17>r <0C>rr <0C>rHr <0C>r<01><01><01><01> <01><01><00><><01>!('<27><> 4<><34>"/<2F><><EFBFBD><EFBFBD>+<2B>`7<><37><EFBFBD>]f<>PH,<2C>F<EFBFBD><46>G<>Dv<44>I<EFBFBD>W<EFBFBD>,i<><69>bH<62>`o<><E6B29D><EFBFBD><EFBFBD>b<EFBFBD><62><EFBFBD>[S<><53>к筻4pWc<>x"L<>G<EFBFBD><47><1C><><1E>#<23>u<EFBFBD> 6<>,́A]Ӡj<1F><><EFBFBD><EFBFBD>51<35><31>$<24><><EFBFBD><EFBFBD><EFBFBD>}<7D>j(<28>t<EFBFBD>k+<2B>z<EFBFBD><7A>G<EFBFBD><01> Wc<57>'3<1A>ɓb~<7E>4<EFBFBD><ZJm<4A><6D>DŽeOO<4F><4F>$[<5B>y<>'<27>PxT6V<36><56>J<><4A><EFBFBD>M<><4D>M¤x<C2A4><78><EFBFBD>VY<56>g<00> <00><00> <00> <01><a
<00> [<00>L <00> <00> <00><00> <00><00>_     . <00><0E>_<00><12>H L N U \ <0B> <0A> V<0E><0E><0E>G<0F>hu<12><12><12><12>J R Y * <0A> <0A> <00><0E><0E><0E><10>Ijw<12><12><12><12> N <0A> 6}<0E><0E>*<0F><11>7r<12>/ <0A> *]<0E><0E><0F><10><10>ly<12>:<0E>.<00>]<00><00>`<00><00>b<00><00> <00>M<00>CU<00> <00><0E>t<12>D8<00>t <00> ( [<00><12><00><00><00><00><00><00><00><00><00><00><00><00><00><00> !%)-159=<00> <00><00>`!<00> <00><00>drrrr<02> <00><><01>!('<27><><EFBFBD>m<>i<>O<18>(?<18>ODHT  <02><><00>4<EFBFBD><ZJm<4A><00><><01>!('<27>,i<><69>bH<62>`4pWc<>x"
6<>,́A] 51<35><31>$<24><><EFBFBD><00><><EFBFBD>]f<>P<00><>M¤x<C2A4><78><00>VY<56>g<00>Dv<44>I<EFBFBD>W<EFBFBD>Ӡj<1F><><EFBFBD><EFBFBD><00><><EFBFBD><EFBFBD>+<2B>`7<00><>}<7D>j(<28>t<00><01> Wc<57>'3<1A>ɓb~<00>DŽeOO<4F><4F><00>b<EFBFBD><62><EFBFBD>[SPxT6V<36><56>H,<2C>F<EFBFBD><46>GJ<><4A><EFBFBD>M$[<5B>y<>'<27><00><>к筻 <00> 4<><34>"/L<>G<EFBFBD><47><1C><> o<><E6B29D><EFBFBD><1E>#<23>u<EFBFBD> <00>k+<2B>z<EFBFBD><7A>GC^0 }?D{A:W?g<><67><EFBFBD><EFBFBD>)<29>e#&]]wv#C^0 }?D{A:W?gbC:\Users\dxzq\.cargo\registry\src\mirrors.ustc.edu.cn-38d0e5eb5da2abae\equivalent-1.0.2\src\lib.rs<72> <1D>Cc<43>a<EFBFBD> <1D>HlkX95>b<><1D>N<EFBFBD><4E>O<00><1A>qMN3M(N)PKL)S
5C
S
6+;(
>%%%&''769 MOO?"C+/ ,*NPP19,/ -%}=ho<68><1E><><EFBFBD><EFBFBD>J0<4A>y3X3x86_64-pc-windows-msvc<76><63><EFBFBD><16><12>D<EFBFBD><44>+<2B>k<EFBFBD>T<EFBFBD><54><01>-e113575d355eefe7<65><37><EFBFBD><01>!('<27><02>6R<02>$<00>#<00>  '' 9'0&66&&&9&& $9  6&w<01>rust-end-file