Trait itermore::IterSorted

source ·
pub trait IterSorted: Iterator {
    fn sorted(self) -> IntoIter<Self::Item>
    where
        Self: Sized,
        Self::Item: Ord
, { ... } fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item>
    where
        Self: Sized,
        F: FnMut(&Self::Item, &Self::Item) -> Ordering
, { ... } fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
    where
        Self: Sized,
        K: Ord,
        F: FnMut(&Self::Item) -> K
, { ... } fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item>
    where
        Self: Sized,
        K: Ord,
        F: FnMut(&Self::Item) -> K
, { ... } fn sorted_unstable(self) -> IntoIter<Self::Item>
    where
        Self: Sized,
        Self::Item: Ord
, { ... } fn sorted_unstabled_by<F>(self, cmp: F) -> IntoIter<Self::Item>
    where
        Self: Sized,
        F: FnMut(&Self::Item, &Self::Item) -> Ordering
, { ... } fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
    where
        Self: Sized,
        K: Ord,
        F: FnMut(&Self::Item) -> K
, { ... } }
Expand description

An extension trait that provides the sorted method and friends for iterators.

Provided Methods§

Sorts the iterator.

Simply collects into a Vec and sorts it using slice::sort.

Sorts the iterator with a comparator function.

Simply collects into a Vec and sorts it using slice::sort_by.

Sorts the iterator with a key extraction function.

Simply collects into a Vec and sorts it using slice::sort_by_key.

Sorts the iterator with a key extraction function.

Simply collects into a Vec and sorts it using slice::sort_by_cached_key.

Sorts the iterator, but might not preserve the order of equal elements.

Simply collects into a Vec and sorts it using slice::sort_unstable.

Sorts the iterator with a comparator function, but might not preserve the order of equal elements.

Simply collects into a Vec and sorts it using slice::sort_unstable_by.

Sorts the iterator with a key extraction function, but might not preserve the order of equal elements.

Simply collects into a Vec and sorts it using slice::sort_unstable_by_key.

Implementors§