Trait ReusableElement

Source
pub trait ReusableElement {
    // Required methods
    fn reset(&mut self);
    fn new() -> Self;
}
Expand description

Implemented on element types to provide a unified interface for creating a new element and reinitializing an existing element

Required Methods§

Source

fn reset(&mut self)

Source

fn new() -> Self

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 ReusableElement for String

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<A: Array> ReusableElement for SmallVec<A>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<K, V> ReusableElement for BTreeMap<K, V>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<K, V> ReusableElement for HashMap<K, V>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for Option<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for BTreeSet<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for LinkedList<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for VecDeque<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for Vec<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T> ReusableElement for HashSet<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Source§

impl<T: Ord> ReusableElement for BinaryHeap<T>

Source§

fn reset(&mut self)

Source§

fn new() -> Self

Implementors§