partial_sort

Trait PartialSort

Source
pub trait PartialSort {
    type Item;

    // Required method
    fn partial_sort<F>(&mut self, last: usize, cmp: F)
       where F: FnMut(&Self::Item, &Self::Item) -> Ordering;
}

Required Associated Types§

Required Methods§

Source

fn partial_sort<F>(&mut self, last: usize, cmp: F)
where F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Rearranges elements such that the range [0, last) contains the smallest last elements in the range [0, n) in ascending order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> PartialSort for [T]

Source§

type Item = T

Source§

fn partial_sort<F>(&mut self, last: usize, cmp: F)
where F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Implementors§