Skip to main content

SortedInsertByKey

Trait SortedInsertByKey 

Source
pub trait SortedInsertByKey<T>: SortedInsertBy<T> {
    // Provided methods
    fn sorted_insert_asc_by_key<A: Ord, F: FnMut(&T) -> &A>(
        &mut self,
        element: T,
        f: F,
    ) -> usize { ... }
    fn sorted_insert_desc_by_key<A: Ord, F: FnMut(&T) -> &A>(
        &mut self,
        element: T,
        f: F,
    ) -> usize { ... }
}

Provided Methods§

Source

fn sorted_insert_asc_by_key<A: Ord, F: FnMut(&T) -> &A>( &mut self, element: T, f: F, ) -> usize

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

Source

fn sorted_insert_desc_by_key<A: Ord, F: FnMut(&T) -> &A>( &mut self, element: T, f: F, ) -> usize

Insert elements to this sorted collection in descending order by a specific key 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> SortedInsertByKey<T> for Vec<T>

Source§

impl<T> SortedInsertByKey<T> for VecDeque<T>

Implementors§