[−][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 get_before<Q: ?Sized>(&self, idx: usize, key: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get_before_mut<Q: ?Sized>(
&mut self,
idx: usize,
key: &Q
) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
&mut self,
idx: usize,
key: &Q
) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
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]
pub fn last_has<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn has_at<Q: ?Sized>(&self, idx: usize, key: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
pub fn child_len(&self) -> usize
[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, S> RefUnwindSafe for ChainMap<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> Send for ChainMap<K, V, S> where
K: Send,
S: Send,
V: Send,
K: Send,
S: Send,
V: Send,
impl<K, V, S> Sync for ChainMap<K, V, S> where
K: Sync,
S: Sync,
V: Sync,
K: Sync,
S: Sync,
V: Sync,
impl<K, V, S> Unpin for ChainMap<K, V, S> where
K: Unpin,
S: Unpin,
V: Unpin,
K: Unpin,
S: Unpin,
V: Unpin,
impl<K, V, S> UnwindSafe for ChainMap<K, V, S> where
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
S: 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>,