Trait rusty_perm::PermFromSorting[][src]

pub trait PermFromSorting<S, T> where
    S: AsRef<[T]>,
    Self: Sized
{ type Output; 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
; }

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

Associated Types

Loading content...

Required methods

fn from_sort(vec: S) -> Self::Output where
    T: Ord
[src]

Builds a permutation by sorting a slice-like type.

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

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

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

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

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

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

Loading content...

Implementors

impl<T> PermFromSorting<&'_ [T], T> for PermD[src]

type Output = Self

impl<T> PermFromSorting<Vec<T, Global>, T> for PermD[src]

type Output = Self

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

type Output = Self

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

type Output = Self

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

type Output = Self

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

type Output = Self

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

type Output = Option<Self>

impl<T, const SIZE: usize> PermFromSorting<Vec<T, Global>, T> for PermS<SIZE>[src]

type Output = Option<Self>

Loading content...