Skip to main content

simulate

Function simulate 

Source
pub fn simulate(
    rule: &TowerRule,
    events: &[Event],
    options: &SimulateOptions,
) -> Result<SimulateReport, SimulateError>
Expand description

Dry-run rule against events using options.

For each event that passes the compiled filter:

  1. Checks the rate predicate (if any) against the simulated clock.
  2. Checks the debounce window against the simulated clock.
  3. Renders the trigger as it would appear to the dispatch engine, without invoking it.

The simulated clock advances by options.event_spacing_ms per event, making debounce and rate window behaviour deterministic.