Skip to main content

Equivalent

Trait Equivalent 

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

Key lookup equivalence.

Lets an Object be queried with any type that compares equal to its Key, such as str or String. The blanket impl covers every Q a Key can be borrowed as.

Required Methods§

Source

fn equivalent(&self, key: &K) -> bool

Checks if self is equivalent to key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,