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

Clears the collection, dropping its elements and returning its length to zero.

Implementors