pub struct DirectBench { /* private fields */ }Expand description
Measures cases by running them over the samples sampling states.
What a case measured is said as soon as it is measured and then let go, so an interrupted run has said everything it finished and a long one keeps nothing.
Implementations§
Source§impl DirectBench
impl DirectBench
Sourcepub fn new(sampling: BenchSampling) -> Self
pub fn new(sampling: BenchSampling) -> Self
Constructs a new DirectBench.
Source§impl DirectBench
impl DirectBench
Sourcepub fn from_args(sampling: BenchSampling) -> Self
pub fn from_args(sampling: BenchSampling) -> Self
Measures the sampling stated, filtered by the first argument that is not a flag.
cargo bench -- "30 sec" measures the cases naming it. Arguments starting with -, which
is what cargo bench passes of its own, are skipped.
Trait Implementations§
Source§impl BenchAlg for DirectBench
impl BenchAlg for DirectBench
Source§impl Clone for DirectBench
impl Clone for DirectBench
Source§fn clone(&self) -> DirectBench
fn clone(&self) -> DirectBench
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DirectBench
impl Debug for DirectBench
Source§impl MeasureBenchAlg for DirectBench
impl MeasureBenchAlg for DirectBench
Auto Trait Implementations§
impl Freeze for DirectBench
impl RefUnwindSafe for DirectBench
impl Send for DirectBench
impl Sync for DirectBench
impl Unpin for DirectBench
impl UnsafeUnpin for DirectBench
impl UnwindSafe for DirectBench
Blanket Implementations§
Source§impl<This> BenchExt<This> for Thiswhere
This: BenchAlg,
impl<This> BenchExt<This> for Thiswhere
This: BenchAlg,
Source§fn one_at_a_time<Stated, Routine>(
&self,
group: &'static str,
cases: Stated,
) -> <This as BenchAlg>::Benchwhere
Stated: IntoIterator<Item = (&'static str, Routine)>,
Routine: FnMut(BenchRounds) -> Duration + 'static,
fn one_at_a_time<Stated, Routine>(
&self,
group: &'static str,
cases: Stated,
) -> <This as BenchAlg>::Benchwhere
Stated: IntoIterator<Item = (&'static str, Routine)>,
Routine: FnMut(BenchRounds) -> Duration + 'static,
States one group whose cases are measured one at a time.
A routine stating Send is taken as well, since a case that may be measured beside others
may also be measured alone.
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