pub trait Benchmark {
type Input;
const SETUP: fn() -> Self::Input;
const MAIN: fn(_: Self::Input);
const PRE_SLEEP_DURATION: Duration = _;
const POST_SLEEP_DURATION: Duration = _;
// Provided method
fn name() -> &'static str { ... }
}
Expand description
A benchmarking function and its inputs.
Required Associated Constants§
Provided Associated Constants§
Sourceconst PRE_SLEEP_DURATION: Duration = _
const PRE_SLEEP_DURATION: Duration = _
cuprate-benchmark
will sleep for this Duration
after
creating the Self::Input
, but before starting Self::MAIN
.
1 second by default.
Sourceconst POST_SLEEP_DURATION: Duration = _
const POST_SLEEP_DURATION: Duration = _
cuprate-benchmark
will sleep for this Duration
after Self::MAIN
.
1 second by default.
Required Associated Types§
Sourcetype Input
type Input
Input to the main benchmarking function.
This is passed to Self::MAIN
.
Provided Methods§
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.