Trait GetKeyValue

Source
pub trait GetKeyValue<T>: CollectionRef + KeyedRef {
    // Required method
    fn get_key_value(
        &self,
        key: T,
    ) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>;
}
Expand description

Queryable map.

Required Methods§

Source

fn get_key_value(&self, key: T) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>

Returns the key-value pair matching the given key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, Q, K, V> GetKeyValue<&'a Q> for BTreeMap<K, V>
where K: Borrow<Q> + Ord, Q: Ord + ?Sized,

Source§

fn get_key_value(&self, key: &'a Q) -> Option<(&K, &V)>

Source§

impl<'a, Q, K, V> GetKeyValue<&'a Q> for HashMap<K, V>
where K: Borrow<Q> + Hash + Eq, Q: Hash + Eq + ?Sized,

Source§

fn get_key_value(&self, key: &'a Q) -> Option<(&K, &V)>

Implementors§

OSZAR »