Trait push_trait::ordered::Insert [] [src]

pub trait Insert<T>: LenMut + PushBack<T> {
    fn insert(&mut self, index: usize, val: T) -> Option<Self::PushedOut>;
}

A trait for moving data to a specific index within a collection.

Unlike Push, insertions must take a linear amount of time and space with respect to the length of both the collection and the inserted item.

Required Methods

Inserts the value at the given position, yielding the value that was pushed out, if any.

Implementors