Trait Scheduler

Source
pub trait Scheduler:
    DynClone
    + Send
    + Sync {
    // Required method
    fn filter_matches(
        &mut self,
        rule: &str,
        ruleset: &str,
        matches: &mut Matches,
    ) -> bool;

    // Provided method
    fn can_stop(&mut self, rules: &[&str], ruleset: &str) -> bool { ... }
}
Expand description

A scheduler decides which matches to be applied for a rule.

The matches that are not chosen in this iteration will be delayed to the next iteration.

Required Methods§

Source

fn filter_matches( &mut self, rule: &str, ruleset: &str, matches: &mut Matches, ) -> bool

Filter the matches for a rule.

Return true if the scheduler’s next run of the rule should feed filter_matches with a new iteration of matches.

Provided Methods§

Source

fn can_stop(&mut self, rules: &[&str], ruleset: &str) -> bool

Whether or not the rules can be considered as saturated (i.e., run_report.updated == false).

This is only called when the runner is otherwise saturated. Default implementation just returns true.

Implementors§