Picker

Trait Picker 

Source
pub trait Picker:
    Debug
    + Sync
    + Send {
    // Required method
    fn pick<'a>(
        &self,
        choices: &'a [Choice],
        scores: &Query<'_, '_, &Score>,
    ) -> Option<&'a Choice>;
}
Expand description

Required trait for Pickers. A Picker is given a slice of choices and a query that can be passed into Choice::calculate.

Implementations of pick must return Some(Choice) for the Choice that was picked, or None.

Required Methods§

Source

fn pick<'a>( &self, choices: &'a [Choice], scores: &Query<'_, '_, &Score>, ) -> Option<&'a Choice>

Implementors§