Struct iai_callgrind::BenchmarkId
source · pub struct BenchmarkId { /* private fields */ }
Expand description
An id for an Arg
which can be used to produce unique ids from parameters
Implementations§
source§impl BenchmarkId
impl BenchmarkId
sourcepub fn new<T, P>(id: T, parameter: P) -> Self
pub fn new<T, P>(id: T, parameter: P) -> Self
Create a new BenchmarkId
.
Use BenchmarkId
as an argument for the id
of an Arg
if you want to create unique
ids from a parameter.
Examples
use iai_callgrind::{binary_benchmark_group, Arg, BinaryBenchmarkGroup, Run, BenchmarkId};
use std::ffi::OsStr;
binary_benchmark_group!(
name = my_exe_group;
benchmark = |"my-exe", group: &mut BinaryBenchmarkGroup| {
for i in 0..10 {
group.bench(Run::with_arg(
Arg::new(BenchmarkId::new("foo with", i), [format!("--foo={i}")])
));
}
}
);
Trait Implementations§
source§impl Clone for BenchmarkId
impl Clone for BenchmarkId
source§fn clone(&self) -> BenchmarkId
fn clone(&self) -> BenchmarkId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BenchmarkId
impl Debug for BenchmarkId
source§impl From<BenchmarkId> for String
impl From<BenchmarkId> for String
source§fn from(value: BenchmarkId) -> Self
fn from(value: BenchmarkId) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for BenchmarkId
impl Send for BenchmarkId
impl Sync for BenchmarkId
impl Unpin for BenchmarkId
impl UnwindSafe for BenchmarkId
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