[−][src]Struct hash_chain::ChainMap
Methods
impl<K: Hash + Eq, V> ChainMap<K, V>[src]
pub fn new(map: HashMap<K, V>) -> Self[src]
pub fn insert(&mut self, key: K, value: V) -> Option<V>[src]
Inserts a key-value pair into the map. If the map did not have this key present, None is returned.
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq, [src]
K: Borrow<Q>,
Q: Hash + Eq,
Returns the key-value pair corresponding to the supplied key.
The supplied key may be any borrowed form of the map's key type, but
Hash and Eq on the borrowed form must match those for
the key type.
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq, [src]
K: Borrow<Q>,
Q: Hash + Eq,
Returns a mutable reference to the value corresponding to the key.
The supplied key may be any borrowed form of the map's key type, but
Hash and Eq on the borrowed form must match those for
the key type.
pub fn new_child(&mut self)[src]
pub fn new_child_with(&mut self, map: HashMap<K, V>)[src]
pub fn remove_child(&mut self) -> Option<HashMap<K, V>>[src]
Trait Implementations
impl<K: Hash + Eq, V> Default for ChainMap<K, V>[src]
impl<'_, K, Q: ?Sized, V> Index<&'_ Q> for ChainMap<K, V> where
K: Eq + Hash + Borrow<Q>,
Q: Eq + Hash, [src]
K: Eq + Hash + Borrow<Q>,
Q: Eq + Hash,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for ChainMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ChainMap<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for ChainMap<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for ChainMap<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for ChainMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,