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: Hash + Eq + Ord + ?Sized;
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: Hash + Eq + Ord + ?Sized;
}
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.