Trait push_trait::sorted::PushSorted [] [src]

pub trait PushSorted<T>: CanPush<T> {
    fn push_sorted(&mut self, val: T) -> Option<Self::PushedOut>;
}

A trait for moving data into a collection while retaining a sorted invariant.

Unlike Push, sorted pushes must take a logarithmic amount of time and space with respect to the length of the collection.

Required Methods

Moves the value into the collection, yielding the value that was pushed out, if any.

This method should retain some sort of sorting invariant within the collection.

Implementors