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 PushedOut
Type of value that gets pushed out, if any.
Required Methods
fn push_sorted(&mut self, val: T) -> Option<Self::PushedOut>
Adds the value to the collection while retaining sorting.
Implementors
impl<K: Ord, V> PushSorted<(K, V)> for BTreeMap<K, V>
impl<T: Ord> PushSorted<T> for BTreeSet<T>
impl<T: Ord> PushSorted<T> for BinaryHeap<T>
impl<T: Ord> PushSorted<T> for IntervalHeap<T>