Skip to main content

MapQuery

Trait MapQuery 

Source
pub trait MapQuery<Q, V>: Len
where Q: ?Sized,
{ // Required methods fn get(&self, key: &Q) -> Option<&V>; fn get_mut(&mut self, key: &Q) -> Option<&mut V>; fn contains_key(&self, key: &Q) -> bool; }
Expand description

Common query abstractions for maps.

Required Methods§

Source

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

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type.

Source

fn get_mut(&mut self, key: &Q) -> Option<&mut V>

Returns a mutable reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type.

Source

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

Returns true if the map contains a value for the specified key.

The key may be any borrowed form of the map’s key type.

Implementations on Foreign Types§

Source§

impl<K, V, Q> MapQuery<Q, V> for BTreeMap<K, V>
where K: Ord + Borrow<Q>, Q: Ord + ?Sized,

Available on crate feature std only.
Source§

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

Source§

fn get_mut(&mut self, key: &Q) -> Option<&mut V>

Source§

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

Source§

impl<K, V, Q, BH> MapQuery<Q, V> for HashMap<K, V, BH>
where K: Hash + Eq + Borrow<Q>, Q: Hash + Eq + ?Sized, BH: BuildHasher,

Available on crate feature std only.
Source§

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

Source§

fn get_mut(&mut self, key: &Q) -> Option<&mut V>

Source§

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

Source§

impl<K, V, Q, BH> MapQuery<Q, V> for HashMap<K, V, BH>
where K: Hash + Eq, Q: Hash + Eq + Equivalent<K> + ?Sized, BH: BuildHasher,

Source§

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

Source§

fn get_mut(&mut self, key: &Q) -> Option<&mut V>

Source§

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

Implementors§

Source§

impl<K, V, Q> MapQuery<Q, V> for DenseScalarLookupMap<K, V>
where Q: Scalar + Comparable<K>,

Source§

impl<K, V, Q> MapQuery<Q, V> for EytzingerSearchMap<K, V>
where Q: Comparable<K> + ?Sized,

Source§

impl<K, V, Q> MapQuery<Q, V> for ScanMap<K, V>
where Q: Equivalent<K> + ?Sized,

Source§

impl<K, V, Q> MapQuery<Q, V> for SparseScalarLookupMap<K, V>
where Q: Scalar + Comparable<K>,

Source§

impl<K, V, Q> MapQuery<Q, V> for FzOrderedMap<K, V>
where Q: Comparable<K> + ?Sized,

Source§

impl<K, V, Q> MapQuery<Q, V> for FzScalarMap<K, V>
where Q: Scalar + Comparable<K>,

Source§

impl<K, V, Q, BH> MapQuery<Q, V> for FzHashMap<K, V, BH>
where Q: Hash + Equivalent<K> + ?Sized, BH: BuildHasher,

Source§

impl<K, V, Q, BH> MapQuery<Q, V> for FzStringMap<K, V, BH>
where Q: AsRef<str>, BH: BuildHasher, str: Equivalent<K>,

Source§

impl<K, V, Q, CM, H> MapQuery<Q, V> for frozen_collections_core::maps::hash_map::HashMap<K, V, CM, H>
where CM: CollectionMagnitude, Q: Equivalent<K> + ?Sized, H: Hasher<Q>,

Source§

impl<K, V, Q, const SZ: usize> MapQuery<Q, V> for InlineDenseScalarLookupMap<K, V, SZ>
where Q: Scalar + Comparable<K>,

Source§

impl<K, V, Q, const SZ: usize> MapQuery<Q, V> for InlineEytzingerSearchMap<K, V, SZ>
where Q: Comparable<K> + ?Sized,

Source§

impl<K, V, Q, const SZ: usize> MapQuery<Q, V> for InlineScanMap<K, V, SZ>
where Q: Equivalent<K> + ?Sized,

Source§

impl<K, V, Q, const SZ: usize, const LTSZ: usize, CM> MapQuery<Q, V> for InlineSparseScalarLookupMap<K, V, SZ, LTSZ, CM>

Source§

impl<K, V, Q, const SZ: usize, const NHS: usize, CM, H> MapQuery<Q, V> for InlineHashMap<K, V, SZ, NHS, CM, H>
where CM: CollectionMagnitude, Q: Equivalent<K> + ?Sized, H: Hasher<Q>,

Source§

impl<K, V, Q, const SZ: usize, const NHS: usize, CM, H> MapQuery<Q, V> for InlineHashMapNoCollisions<K, V, SZ, NHS, CM, H>
where CM: CollectionMagnitude, Q: Equivalent<K> + ?Sized, H: Hasher<Q>,