pub trait ObjectMut {
type Key: ?Sized;
type Element;
// Required methods
fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Element>
where Self::Key: Borrow<Q>,
Q: ?Sized + Hash + Eq + Ord;
fn insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Element>
where Self::Key: From<K> + Hash + Eq,
V: Into<Self::Element>;
fn remove<Q>(&mut self, k: &Q) -> Option<Self::Element>
where Self::Key: Borrow<Q>,
Q: ?Sized + Hash + Eq + Ord;
}
Expand description
A mutable value Object
Required Associated Types§
Required Methods§
Sourcefn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Element>
fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Element>
Gets the value of a key as a mutable reference.
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<MapK, MapE, S> ObjectMut for HashMap<MapK, MapE, S>
Available on crate feature halfbrown
only.
impl<MapK, MapE, S> ObjectMut for HashMap<MapK, MapE, S>
Available on crate feature
halfbrown
only.