Trait len_trait::len::LenMut [] [src]

pub trait LenMut: Default + Clear {
    fn truncate(&mut self, len: usize);
    fn split_off(&mut self, index: usize) -> Self;
}

A trait for modifying the length of a collection.

These methods must take at most a linear amount of time and space with respect to the number of elements which are moved or dropped.

Required Methods

Truncates the collection to be no greater than len long, dropping elements as needed.

If the collection is less than len long, do nothing.

Splits off the collection at the given index, returning the data past the index.

Implementors