Skip to main content

ClearInto

Trait ClearInto 

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

Trait for types that can be cleared in place. Implemented for the collection types used as cache values (HashMap, Vec).

Used by lock_or_clear_cache to wipe cache data after a poisoned mutex recovery, since a partially-mutated cache (from a panic mid-insert) must not be reused on subsequent frames.

Required Methods§

Source

fn clear_into(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<K, V, S> ClearInto for HashMap<K, V, S>
where S: BuildHasher,

Source§

fn clear_into(&mut self)

Source§

impl<T> ClearInto for Vec<T>

Source§

fn clear_into(&mut self)

Implementors§