pub struct Benchmarks { /* private fields */ }Expand description
A collection of registered benchmarks.
Implementations§
Source§impl Benchmarks
impl Benchmarks
Sourcepub fn register<T>(&mut self, name: impl Into<String>, benchmark: T)where
T: Benchmark,
pub fn register<T>(&mut self, name: impl Into<String>, benchmark: T)where
T: Benchmark,
Register a new benchmark with the given name.
Sourcepub fn has_match(&self, job: &Any) -> bool
pub fn has_match(&self, job: &Any) -> bool
Return true if job matches with any registered benchmark. Otherwise, return false.
Sourcepub fn call(
&self,
job: &Any,
checkpoint: Checkpoint<'_>,
output: &mut dyn Output,
) -> Result<Value>
pub fn call( &self, job: &Any, checkpoint: Checkpoint<'_>, output: &mut dyn Output, ) -> Result<Value>
Attempt to run the best matching benchmark for job.
Returns the results of the benchmark if successful.
Errors if a suitable method could not be found or if the invoked benchmark failed.
Sourcepub fn debug(&self, job: &Any, max_methods: usize) -> Result<(), Vec<Mismatch>>
pub fn debug(&self, job: &Any, max_methods: usize) -> Result<(), Vec<Mismatch>>
Attempt to debug reasons for a missed dispatch, returning at most max_methods
reasons.
Returns Ok(()) if a match was found.
Sourcepub fn register_regression<T>(&mut self, name: impl Into<String>, benchmark: T)where
T: Regression,
pub fn register_regression<T>(&mut self, name: impl Into<String>, benchmark: T)where
T: Regression,
Register a regression-checkable benchmark with the associated name.
Upon registration, the associated Regression::Tolerances input and the benchmark
itself will be reachable via Check.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Benchmarks
impl !RefUnwindSafe for Benchmarks
impl !Send for Benchmarks
impl !Sync for Benchmarks
impl Unpin for Benchmarks
impl UnsafeUnpin for Benchmarks
impl !UnwindSafe for Benchmarks
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
Source§impl<T> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
Errors that can occur during
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Perform the actual conversion. Read more
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Write a description of the dispatch rule and outcome to the formatter. Read more
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
The equivalent of
try_match but returns a reason for a failed score. Read more