pub struct BenchFunction {
pub name: &'static str,
pub runner: fn(BenchSpec) -> Result<BenchReport, TimingError>,
}Available on crate feature
full only.Expand description
A registered benchmark function
This struct is submitted to the global registry by the #[benchmark] macro.
It contains the function’s name and a runner that executes the benchmark.
Fields§
§name: &'static strFully-qualified name of the benchmark function (e.g., “my_crate::my_module::my_bench”)
runner: fn(BenchSpec) -> Result<BenchReport, TimingError>Runner function that executes the benchmark with timing
Takes a BenchSpec and returns a BenchReport directly. The runner handles setup/teardown internally.
Trait Implementations§
impl Collect for BenchFunction
Auto Trait Implementations§
impl Freeze for BenchFunction
impl RefUnwindSafe for BenchFunction
impl Send for BenchFunction
impl Sync for BenchFunction
impl Unpin for BenchFunction
impl UnwindSafe for BenchFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more