Trait len_trait::len::Clear
[−]
[src]
pub trait Clear: Len { fn clear(&mut self); }
A trait for clearing collections.
A collection is cleared by dropping all of its data. After clear
is called, the collection is
guaranteed to be empty.
Clearing a collection must take at most a linear amount of time and space.
Required Methods
fn clear(&mut self)
Clears the collection, dropping its elements and returning its length to zero.
Implementors
impl Clear for OsString
impl<K: Eq + Hash, V> Clear for HashMap<K, V>
impl<T: Eq + Hash> Clear for HashSet<T>
impl<K: Ord, V> Clear for BTreeMap<K, V>
impl<T: Ord> Clear for BTreeSet<T>
impl<T: Ord> Clear for BinaryHeap<T>
impl<T> Clear for LinkedList<T>
impl Clear for String
impl<T> Clear for Vec<T>
impl<T> Clear for VecDeque<T>