Trait ContainerRemove

Source
pub trait ContainerRemove: SparseContainer {
    // Required method
    fn remove(&mut self, input: &Self::Input) -> Option<Self::Output>;
}
Expand description

A trait to remove items from a container, to prevent growth without bound.

Required Methods§

Source

fn remove(&mut self, input: &Self::Input) -> Option<Self::Output>

Removes the input from the cache, returning any value if the input was previously in the cache.

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<I, O> ContainerRemove for BTreeMap<I, O>
where I: Ord,

Source§

fn remove(&mut self, input: &Self::Input) -> Option<Self::Output>

Source§

impl<I, O, S> ContainerRemove for HashMap<I, O, S>
where I: Eq + Hash, S: BuildHasher,

Source§

fn remove(&mut self, input: &I) -> Option<O>

Implementors§