pub trait Benchmark: Plugin {
// Required methods
fn descriptor(&self) -> &'static BenchmarkDescriptor;
fn parameters(&self) -> Vec<ParamSpec>;
fn configure(&mut self, values: &ParamValues) -> Result<()>;
fn next(&mut self) -> impl Future<Output = Result<BenchmarkResult>> + Send;
// Provided methods
fn run(&mut self) -> impl Stream<Item = Result<BenchmarkResult>> + '_
where Self: Sized + Send { ... }
fn cleanup(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
}Required Methods§
fn descriptor(&self) -> &'static BenchmarkDescriptor
Sourcefn parameters(&self) -> Vec<ParamSpec>
fn parameters(&self) -> Vec<ParamSpec>
2026-09-26: The parameters shown before the run starts, so the user can change them. Their defaults are in the returned specs.
Sourcefn configure(&mut self, values: &ParamValues) -> Result<()>
fn configure(&mut self, values: &ParamValues) -> Result<()>
2026-09-26: Receive the edited values. Validate here and return an
error naming the offending field; the executor calls next() only after
this returns Ok.
Provided Methods§
Sourcefn run(&mut self) -> impl Stream<Item = Result<BenchmarkResult>> + '_
fn run(&mut self) -> impl Stream<Item = Result<BenchmarkResult>> + '_
2026-09-26: Drive next() to completion, streaming every frame. The
stream ends after the first terminal crate::RunStatus, or after an
error. It does not call cleanup().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.