Skip to main content

EngineListener

Trait EngineListener 

Source
pub trait EngineListener: Send + Sync {
    // Provided methods
    fn begin_cycle(&self, _cycle: u64) { ... }
    fn evaluate_rule(&self, _cycle: u64, _rule: &Rule, _matched: bool) { ... }
    fn execute_rule(&self, _cycle: u64, _rule: &Rule) { ... }
}
Expand description

Receives notifications as the engine runs, like Grule’s GruleEngineListener. All methods do nothing by default.

Provided Methods§

Source

fn begin_cycle(&self, _cycle: u64)

A new cycle is starting (cycles are numbered from 1).

Source

fn evaluate_rule(&self, _cycle: u64, _rule: &Rule, _matched: bool)

A rule’s condition was evaluated; matched is whether it held.

Source

fn execute_rule(&self, _cycle: u64, _rule: &Rule)

A rule was chosen and its actions are about to run.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§