GetMut

Trait GetMut 

Source
pub trait GetMut<T>: Get<T> + CollectionMut {
    // Required method
    fn get_mut(&mut self, key: T) -> Option<Self::ItemMut<'_>>;
}
Expand description

Mutably queryable collection.

Required Methods§

Source

fn get_mut(&mut self, key: T) -> Option<Self::ItemMut<'_>>

Returns a mutable reference to the item stored behind the given key (if any).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, Q, K, V> GetMut<&'a Q> for BTreeMap<K, V>
where K: Borrow<Q> + Ord, Q: Ord + ?Sized,

Source§

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

Source§

impl<'a, Q, K, V> GetMut<&'a Q> for HashMap<K, V>
where K: Borrow<Q> + Hash + Eq, Q: Hash + Eq + ?Sized,

Source§

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

Source§

impl<T> GetMut<usize> for Vec<T>

Source§

fn get_mut(&mut self, index: usize) -> Option<&mut T>

Implementors§