Skip to main content

PermFromSorting

Trait PermFromSorting 

Source
pub trait PermFromSorting<S, T>
where S: AsRef<[T]>, Self: Sized,
{ type Output; // Required methods fn from_sort(vec: S) -> Self::Output where T: Ord; fn from_sort_by<F>(vec: S, compare: F) -> Self::Output where F: FnMut(&T, &T) -> Ordering; fn from_sort_by_key<B, F>(vec: S, f: F) -> Self::Output where B: Ord, F: FnMut(&T) -> B; fn from_sort_by_cached_key<B, F>(vec: S, f: F) -> Self::Output where B: Ord, F: FnMut(&T) -> B; }
Expand description

An operator that builds a permutation type by sorting slice-like types.

Required Associated Types§

Required Methods§

Source

fn from_sort(vec: S) -> Self::Output
where T: Ord,

Builds a permutation by sorting a slice-like type.

Source

fn from_sort_by<F>(vec: S, compare: F) -> Self::Output
where F: FnMut(&T, &T) -> Ordering,

Builds a permutation by sorting a slice-like type with a comparing function.

Source

fn from_sort_by_key<B, F>(vec: S, f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function.

Source

fn from_sort_by_cached_key<B, F>(vec: S, f: F) -> Self::Output
where B: Ord, F: FnMut(&T) -> B,

Builds a permutation by sorting a slice-like type with a key function. The key is not re-computed twice.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, const SIZE: usize> PermFromSorting<&[T; SIZE], T> for PermD

Source§

impl<T, const SIZE: usize> PermFromSorting<&[T; SIZE], T> for PermS<SIZE>

Source§

type Output = Perm<Static<SIZE>>

Source§

impl<T, const SIZE: usize> PermFromSorting<&[T], T> for PermS<SIZE>

Source§

impl<T, const SIZE: usize> PermFromSorting<Vec<T>, T> for PermS<SIZE>

Source§

impl<T, const SIZE: usize> PermFromSorting<[T; SIZE], T> for PermD

Source§

impl<T, const SIZE: usize> PermFromSorting<[T; SIZE], T> for PermS<SIZE>

Source§

type Output = Perm<Static<SIZE>>

Source§

impl<T> PermFromSorting<&[T], T> for PermD

Source§

impl<T> PermFromSorting<Vec<T>, T> for PermD