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§
Sourcefn kind(&self) -> BackendKind
fn kind(&self) -> BackendKind
Which kind of backend this is (recorded in report metadata).
Sourcefn run(&self, scenario: &Scenario) -> Result<SimulationOutput>
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§
Sourcefn is_deterministic(&self) -> bool
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".