1 2 3 4 5 6 7 8 9 10 11
use std::cmp::Ordering; use super::Collection; /// Implements an interface for collections that can be sorted. /// /// A collection that implements this trait must /// be able to re-order its elements in a specific order (sorting). pub trait Sortable: Collection { fn sort<F>(&mut self, f: F) where F: FnMut(&Self::Item, &Self::Item) -> Ordering; }