Trait grabbag::iter::SortedIterator [] [src]

pub trait SortedIterator<E>: Iterator<Item=E> + Sized where E: Ord {
    fn sorted(self) -> Vec<E>;
    fn sorted_by<F: FnMut(&E, &E) -> Ordering>(self, compare: F) -> Vec<E>;
}

Shorthand for collecting and sorting an iterator.

Required Methods

fn sorted(self) -> Vec<E>

Returns a Vec with the elements of the input iterator in sorted order.

fn sorted_by<F: FnMut(&E, &E) -> Ordering>(self, compare: F) -> Vec<E>

Returns a Vec with the elements of the input iterator in sorted order, as specified by a comparison function.

Implementors