Trait push_trait::PushSorted [] [src]

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

A mutable collection onto which items can be added while retaining a sorting variant.

Unlike a regular Push<T> implementation, sorted pushes must take amortized O(m log n) time and O(1) space, where m is the length of the pushed item and n is the length of the collection.

Associated Types

Type of value that gets pushed out, if any.

Required Methods

Adds the value to the collection while retaining sorting.

Implementors