pub trait MapQuery<Q, V>: Lenwhere
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§
Sourcefn get(&self, key: &Q) -> Option<&V>
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.
Sourcefn get_mut(&mut self, key: &Q) -> Option<&mut V>
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.
Sourcefn contains_key(&self, key: &Q) -> bool
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.