pub struct Debt { /* private fields */ }Expand description
The recorded debt.
Implementations§
Source§impl Debt
impl Debt
Sourcepub fn record(
&mut self,
gate: GateId,
path: &str,
dimension: &'static str,
value: Recorded,
)
pub fn record( &mut self, gate: GateId, path: &str, dimension: &'static str, value: Recorded, )
Record one dimension.
Sourcepub fn recorded(
&self,
gate: GateId,
path: &str,
dimension: &str,
) -> Option<Recorded>
pub fn recorded( &self, gate: GateId, path: &str, dimension: &str, ) -> Option<Recorded>
What is recorded for one dimension of one path.
Sourcepub fn recorded_for(
&self,
gate: GateId,
) -> Vec<(String, &'static str, Recorded)>
pub fn recorded_for( &self, gate: GateId, ) -> Vec<(String, &'static str, Recorded)>
Every recorded dimension of one gate, as (path, dimension, value).
Sourcepub fn baseline(measurements: &[Measurement]) -> Self
pub fn baseline(measurements: &[Measurement]) -> Self
The debt a set of measurements becomes: every violating dimension, at the measurement.
Sourcepub fn tighten(&self, measurements: &[Measurement]) -> Tightened
pub fn tighten(&self, measurements: &[Measurement]) -> Tightened
The debt after every ceiling comes down to its measurement.
A ceiling never rises and a cleared exception is never reinstated. A dimension within its budget, a corrected condition, and a path the gate no longer measures all leave the file. A measurement above its ceiling is reported and left alone, because the gate already fails on it and lowering is not the fix.
Sourcepub fn parse(text: &str) -> Result<Self, DebtError>
pub fn parse(text: &str) -> Result<Self, DebtError>
Parse a debt file.
§Errors
DebtError::Shape when the text is not a mapping of this schema,
and DebtError::Malformed naming the gate and path of the first
entry that is not of the expected shape. Neither falls back to the
empty debt: a file that quietly stops applying turns a green commit
into a false pass.
Sourcepub fn read(root: &Utf8Path) -> Result<Self, DebtError>
pub fn read(root: &Utf8Path) -> Result<Self, DebtError>
Read the debt an instance carries.
An absent file is the empty debt and never an error: nothing delivers the file, so absence is the ordinary state.
§Errors
DebtError::TwoFormats when the legacy list sits beside the file,
and the parse errors of Self::parse.
Trait Implementations§
impl Eq for Debt
impl StructuralPartialEq for Debt
Auto Trait Implementations§
impl Freeze for Debt
impl RefUnwindSafe for Debt
impl Send for Debt
impl Sync for Debt
impl Unpin for Debt
impl UnsafeUnpin for Debt
impl UnwindSafe for Debt
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.