pub struct Registry { /* private fields */ }Expand description
A collection of registered inputs and benchmarks.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn input(&self, tag: &str) -> Option<Registered<'_>>
pub fn input(&self, tag: &str) -> Option<Registered<'_>>
Return the input with the registered tag if present. Otherwise, return None.
Inputs are automatically registered as a side-effect of:
Return an iterator over all registered input tags in an unspecified order.
Sourcepub fn register<T>(
&mut self,
name: impl Into<String>,
benchmark: T,
) -> Result<(), RegistryError>where
T: Benchmark,
pub fn register<T>(
&mut self,
name: impl Into<String>,
benchmark: T,
) -> Result<(), RegistryError>where
T: Benchmark,
Register a new benchmark with the given name.
As a side-effect, the benchmark’s Input type is also registered.
Duplicate registrations of the same tag and type are allowed; mismatched types for the
same tag return an error.
Sourcepub fn register_regression<T>(
&mut self,
name: impl Into<String>,
benchmark: T,
) -> Result<(), RegistryError>where
T: Regression,
pub fn register_regression<T>(
&mut self,
name: impl Into<String>,
benchmark: T,
) -> Result<(), RegistryError>where
T: Regression,
Register a regression-checkable benchmark with the given name.
As a side-effect, the benchmark’s Input type is also registered.
Duplicate registrations of the same tag and type are allowed; mismatched types for the
same tag return an error.
Upon registration, the associated Regression::Tolerances input and the benchmark
itself will be reachable via Check.