Skip to main content

Remove

Trait Remove 

Source
pub trait Remove<T>: Collection {
    // Required method
    fn remove(&mut self, key: T) -> Option<Self::Item>;
}
Expand description

Mutable collection where elements can be removed from.

Required Methods§

Source

fn remove(&mut self, key: T) -> Option<Self::Item>

Remove the element identified by the given key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<'a, Q, T> Remove<&'a Q> for BTreeSet<T>
where T: Borrow<Q> + Ord, Q: Ord + ?Sized,

Source§

fn remove(&mut self, t: &'a Q) -> Option<T>

Source§

impl<'a, Q, T> Remove<&'a Q> for HashSet<T>
where T: Borrow<Q> + Hash + Eq, Q: Hash + Eq + ?Sized,

Source§

fn remove(&mut self, t: &'a Q) -> Option<T>

Source§

impl<T> Remove<usize> for Vec<T>

Source§

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

Implementors§