Skip to main content

Clearable

Trait Clearable 

Source
pub trait Clearable {
    // Required method
    fn clear(self);
}

Required Methods§

Source

fn clear(self)

Removes all elements from a collection.

use traiter::collections::{Clearable, Emptiable};
let mut collection = vec![0];
assert!(!Emptiable::is_empty(&collection));
Clearable::clear(&mut collection);
assert!(Emptiable::is_empty(&collection));

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Element, State> Clearable for &mut HashSet<Element, State>

Source§

fn clear(self)

Source§

impl<Element: PartialEq> Clearable for &mut Vec<Element>

Source§

fn clear(self)

Source§

impl<Element: PartialEq> Clearable for &mut VecDeque<Element>

Source§

fn clear(self)

Source§

impl<Key, Value, State> Clearable for &mut HashMap<Key, Value, State>

Source§

fn clear(self)

Implementors§