Trait IntoSortedUnstable

Source
pub trait IntoSortedUnstable<Item>: IsArray<Item> {
    // Required methods
    fn into_sorted_unstable(self) -> Self
       where Item: Ord;
    fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
       where Order: FnMut(&Item, &Item) -> Ordering;
    fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
       where GetKey: FnMut(&Item) -> Key,
             Key: Ord;
}
Expand description

Utility methods to sort various types of arrays with an unstable algorithm.

Required Methods§

Source

fn into_sorted_unstable(self) -> Self
where Item: Ord,

Sort an array by Ord and return it.

This function calls slice::sort_unstable under the hook.

Source

fn into_sorted_unstable_by<Order>(self, order: Order) -> Self
where Order: FnMut(&Item, &Item) -> Ordering,

Sort an array by a function and return it.

This function calls slice::sort_unstable_by under the hook.

Source

fn into_sorted_unstable_by_key<Key, GetKey>(self, get_key: GetKey) -> Self
where GetKey: FnMut(&Item) -> Key, Key: Ord,

Sort an array by a key extraction function and return it.

This function calls slice::sort_unstable_by_key under the hook.

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.

Implementors§

Source§

impl<Item, Array> IntoSortedUnstable<Item> for Array
where Array: AsMut<[Item]> + Sized,