#[non_exhaustive]pub struct ComparisonInputs {
pub tolerance_pct: f64,
pub dispositions: BTreeMap<String, String>,
}Expand description
Everything the comparison stage needs beyond the two bundles.
Why: tolerance and dispositions arrive from different places (a flag and a
file in the candidate bundle) and both are optional; bundling them keeps
compare_against_baseline to three arguments.
What: the tolerance percentage and the disposition map read from
DISPOSITIONS_FILE.
Test: bakeoff::tests::a_documented_disposition_clears_a_performance_change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tolerance_pct: f64Percentage change allowed before a metric needs a disposition.
dispositions: BTreeMap<String, String>Metric key (L3.turns) to the operator’s written acceptance.
Implementations§
Source§impl ComparisonInputs
impl ComparisonInputs
Sourcepub fn load(bundle: &Bundle, tolerance_pct: f64) -> Result<Self, String>
pub fn load(bundle: &Bundle, tolerance_pct: f64) -> Result<Self, String>
Load <bundle>/dispositions.json, treating an absent file as none.
Why: most bundles have no accepted regression, so requiring the file
would be ceremony. A file that exists but does not parse is an error,
not silently-none: an operator who wrote a disposition and typoed the
JSON must not be told their regression is undispositioned.
What: returns the parsed map, an empty map when the file is absent, or
the parse error.
Test: bakeoff::tests::a_documented_disposition_clears_a_performance_change,
bakeoff::tests::a_malformed_dispositions_file_is_an_error.
Trait Implementations§
Source§impl Clone for ComparisonInputs
impl Clone for ComparisonInputs
Source§impl Debug for ComparisonInputs
impl Debug for ComparisonInputs
Auto Trait Implementations§
impl Freeze for ComparisonInputs
impl RefUnwindSafe for ComparisonInputs
impl Send for ComparisonInputs
impl Sync for ComparisonInputs
impl Unpin for ComparisonInputs
impl UnsafeUnpin for ComparisonInputs
impl UnwindSafe for ComparisonInputs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more