Trait ContainerClear

Source
pub trait ContainerClear {
    // Required method
    fn clear(&mut self);
}
Expand description

A trait to clear the container, for cases when caching may need to be temporary during some calcuations, but may grow unbounded over the course of the program otherwise.

Required Methods§

Source

fn clear(&mut self)

Clears the cache, removing all key-value pairs. Keeps the allocated memory for reuse.

Implementations on Foreign Types§

Source§

impl<I, O> ContainerClear for BTreeMap<I, O>
where I: Ord,

Source§

fn clear(&mut self)

Source§

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

Source§

fn clear(&mut self)

Implementors§