Skip to main content

SortedInsertBy

Trait SortedInsertBy 

Source
pub trait SortedInsertBy<T>: SortedInsertBasic<T> {
    // Provided method
    fn sorted_insert_by<F: FnMut(&T, &T) -> bool>(
        &mut self,
        element: T,
        f: F,
    ) -> usize { ... }
}

Provided Methods§

Source

fn sorted_insert_by<F: FnMut(&T, &T) -> bool>( &mut self, element: T, f: F, ) -> usize

Insert elements to this sorted collection by a specific comparator 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> SortedInsertBy<T> for Vec<T>

Source§

impl<T> SortedInsertBy<T> for VecDeque<T>

Implementors§