Skip to main content

SaliencyStrategy

Trait SaliencyStrategy 

Source
pub trait SaliencyStrategy:
    Send
    + Sync
    + 'static {
    // Required method
    fn select(&mut self, candidates: &[Candidate<'_>]) -> Option<usize>;
}
Expand description

Selects one candidate from a list of available variants.

Implement this trait to customise line-group and node-group selection behaviour. Strategies may be stateful (e.g. tracking which variants have been recently shown).

Required Methods§

Source

fn select(&mut self, candidates: &[Candidate<'_>]) -> Option<usize>

Returns the index into candidates of the chosen variant, or None to skip the group.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§