Trait divan::counter::IntoCounter
source · pub trait IntoCounter {
type Counter: Counter;
// Required method
fn into_counter(self) -> Self::Counter;
}
Expand description
Conversion into a Counter
.
Examples
This trait is implemented for unsigned integers over
ItemsCount
:
#[divan::bench]
fn sort_values(bencher: divan::Bencher) {
let mut values: Vec<T> = // ...
bencher
.counter(values.len())
.bench_local(|| {
divan::black_box(&mut values).sort();
});
}
Required Associated Types§
Required Methods§
sourcefn into_counter(self) -> Self::Counter
fn into_counter(self) -> Self::Counter
Converts into a Counter
.