Skip to main content

SortedInsert

Trait SortedInsert 

Source
pub trait SortedInsert<T: Ord>: SortedInsertByKey<T> {
    // Provided methods
    fn sorted_insert_asc(&mut self, element: T) -> usize { ... }
    fn sorted_insert_desc(&mut self, element: T) -> usize { ... }
}

Provided Methods§

Source

fn sorted_insert_asc(&mut self, element: T) -> usize

Insert elements to this sorted collection in ascending order and return the inserted index. Use linear search to find the index where a matching element could be inserted.

Source

fn sorted_insert_desc(&mut self, element: T) -> usize

Insert elements to this sorted collection in descending order and return the inserted index. Use linear search to find the index where a matching element could be inserted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Ord> SortedInsert<T> for Vec<T>

Source§

impl<T: Ord> SortedInsert<T> for VecDeque<T>

Implementors§