pub struct Report {
pub rows: Vec<(String, f64, f64)>,
pub units: Vec<Unit>,
}Expand description
What changed from a to b.
Fields§
§rows: Vec<(String, f64, f64)>(what, before, after), µs or a count.
units: Vec<Unit>Each row’s unit, by index; a row past its end is Unit::Us.
Implementations§
Source§impl Report
impl Report
Sourcepub fn push(
&mut self,
what: impl Into<String>,
unit: Unit,
before: f64,
after: f64,
)
pub fn push( &mut self, what: impl Into<String>, unit: Unit, before: f64, after: f64, )
Adds a row.
Sourcepub fn growth(&self, i: usize) -> Option<f64>
pub fn growth(&self, i: usize) -> Option<f64>
Row i’s growth as a fraction of its before, when it counts.
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
The report as text, a row a line, marking a counted row that grew
or shrank past MARK.
Sourcepub fn text_with(&self, threshold: f64) -> String
pub fn text_with(&self, threshold: f64) -> String
The report as text, marking a counted row whose change passes
threshold (a fraction): ▲ grew, ▼ shrank.
Sourcepub fn worst_growth(&self) -> f64
pub fn worst_growth(&self) -> f64
The largest growth of any row, as a fraction of its before: over
the rows that count (Unit::counts), 0 when none does.
Trait Implementations§
impl StructuralPartialEq for Report
Auto Trait Implementations§
impl Forget for Report
impl Freeze for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnsafeUnpin for Report
impl UnwindSafe for Report
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