Trait push_trait::Push [] [src]

pub trait Push<T>: LenZero {
    type PushedOut;
    fn push(&mut self, val: T) -> Option<Self::PushedOut>;
}

A mutable collection onto which items can be added to an arbitrary location in the collection.

Pushing an item must never decrease the length of a collection, and it usually increases it. Additionally, the push must take amortized O(n) time and space to complete with respect to the length of the pushed value.

Associated Types

Type of value that gets pushed out, if any.

For some collections, a value may be "pushed out" after a value is pushed.

Required Methods

Adds the value to the collection.

Implementors