Skip to main content

ExecutionBackend

Trait ExecutionBackend 

Source
pub trait ExecutionBackend {
    // Required methods
    fn kind(&self) -> BackendKind;
    fn run(&self, scenario: &Scenario) -> Result<SimulationOutput>;

    // Provided method
    fn is_deterministic(&self) -> bool { ... }
}
Expand description

Anything that can execute a scenario and return logs.

Required Methods§

Source

fn kind(&self) -> BackendKind

Which kind of backend this is (recorded in report metadata).

Source

fn run(&self, scenario: &Scenario) -> Result<SimulationOutput>

Execute scenario, returning its raw logs.

§Errors

Returns crate::Error::Simulation on execution failure, or crate::Error::BackendUnimplemented for skeleton backends.

Provided Methods§

Source

fn is_deterministic(&self) -> bool

Whether re-running the same scenario always yields identical logs.

Deterministic backends (e.g. recorded-log replay) gain nothing from multi-sampling — Scenario::samples is ignored for them, so the profiler never reports fabricated run-to-run variance. Live execution backends that can vary between runs override this to false (the default) so sampling applies. See crate::profiler::Profiler::run.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§