# Trait flechasdb::nbest::TakeNBestByKey

source ·

    pub trait TakeNBestByKey<T>where
        Self: Sized,{
        // Required method
        fn n_best_by_key<K, F>(self, n: usize, f: F) -> NBestByKey<T, K, F>
           where F: FnMut(&T) -> K,
                 K: PartialOrd;
    }

Expand description

Trait to select n-best elements in a collection.

Intended to be implemented for `Iterator`.

## Required Methods§

source

#### fn n_best_by_key<K, F>(self, n: usize, f: F) -> NBestByKey<T, K, F>where F: FnMut(&T) -> K, K: PartialOrd,

Selects n-best elements in the iterator.

## Implementors§

source§

### impl<I, T> TakeNBestByKey<T> for Iwhere I: Iterator<Item = T> + Sized,