• Home
Name Date Size #Lines LOC

..--

src/04-Jul-2025-11429

.android-checksum.jsonD04-Jul-2025854 11

.cargo-checksum.jsonD04-Jul-2025492 11

Android.bpD04-Jul-2025851 3228

Cargo.tomlD04-Jul-2025946 3835

LICENSED04-Jul-202510.6 KiB202169

LICENSE-APACHED04-Jul-202510.6 KiB202169

METADATAD04-Jul-2025382 1817

MODULE_LICENSE_APACHE2D04-Jul-20250

README.mdD04-Jul-20251.1 KiB2618

cargo_embargo.jsonD04-Jul-202552 54

README.md

1# Equivalent
2
3[![crates.io](https://img.shields.io/crates/v/equivalent.svg)](https://crates.io/crates/equivalent)
4[![docs](https://docs.rs/equivalent/badge.svg)](https://docs.rs/equivalent)
5
6`Equivalent` and `Comparable` are Rust traits for key comparison in maps.
7
8These may be used in the implementation of maps where the lookup type `Q`
9may be different than the stored key type `K`.
10
11* `Q: Equivalent<K>` checks for equality, similar to the `HashMap<K, V>`
12  constraint `K: Borrow<Q>, Q: Eq`.
13* `Q: Comparable<K>` checks the ordering, similar to the `BTreeMap<K, V>`
14  constraint `K: Borrow<Q>, Q: Ord`.
15
16These traits are not used by the maps in the standard library, but they may
17add more flexibility in third-party map implementations, especially in
18situations where a strict `K: Borrow<Q>` relationship is not available.
19
20## License
21
22Equivalent is distributed under the terms of both the MIT license and the
23Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and
24[LICENSE-MIT](LICENSE-MIT) for details. Opening a pull request is
25assumed to signal agreement with these licensing terms.
26