KeyedAccess

Trait KeyedAccess 

Source
pub trait KeyedAccess<Q: ?Sized> {
    type Value;

    // Required method
    fn get(&self, key: &Q) -> Option<&Self::Value>;

    // Provided method
    fn contains_key(&self, key: &Q) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn get(&self, key: &Q) -> Option<&Self::Value>

Provided Methods§

Source

fn contains_key(&self, key: &Q) -> bool

Implementations on Foreign Types§

Source§

impl<K, Q: Equivalent<K> + Hash + ?Sized, H: BuildHasher> KeyedAccess<Q> for IndexSet<K, H>

Source§

type Value = ()

Source§

fn get(&self, key: &Q) -> Option<&Self::Value>

Source§

fn contains_key(&self, key: &Q) -> bool

Source§

impl<K, V, H: BuildHasher, Q: Equivalent<K> + Hash + ?Sized> KeyedAccess<Q> for IndexMap<K, V, H>

Source§

type Value = V

Source§

fn get(&self, key: &Q) -> Option<&Self::Value>

Source§

fn contains_key(&self, key: &Q) -> bool

Source§

impl<K: Eq + Hash + Borrow<Q>, Q: Eq + Hash + ?Sized, H: BuildHasher> KeyedAccess<Q> for HashSet<K, H>

Source§

type Value = ()

Source§

fn get(&self, key: &Q) -> Option<&Self::Value>

Source§

fn contains_key(&self, key: &Q) -> bool

Source§

impl<K: Eq + Hash + Borrow<Q>, V, H: BuildHasher, Q: Eq + Hash + ?Sized> KeyedAccess<Q> for HashMap<K, V, H>

Source§

type Value = V

Source§

fn get(&self, key: &Q) -> Option<&Self::Value>

Source§

fn contains_key(&self, key: &Q) -> bool

Implementors§