Trait Equivalent
trait Equivalent<K: ?Sized>
Key equivalence trait.
This trait defines the function used to compare the input value with the
map keys (or set values) during a lookup operation such as HashMap::get
or HashSet::contains.
It is provided with a blanket implementation based on the
Borrow trait.
Correctness
Equivalent values must hash to the same value.
Required Methods
fn equivalent(self: &Self, key: &K) -> boolChecks if this value is equivalent to the given key.
Returns
trueif both values are equivalent, andfalseotherwise.Correctness
When this function returns
true, bothselfandkeymust hash to the same value.
Implementors
impl<Q, K> Equivalent for HashSet<T, S, A>impl<Q, K> Equivalent for Qimpl<Q, K> Equivalent for TryReserveErrorimpl<Q, K> Equivalent for HashMap<K, V, S, A>