Skip to main content

BaselineStore

Trait BaselineStore 

Source
pub trait BaselineStore {
    // Required methods
    fn load(&self, scope: &str, name: &str) -> Result<Option<Baseline>>;
    fn save(&self, scope: &str, baseline: &Baseline) -> Result<()>;
}
Expand description

Storage backend for Baseline values.

Implementations MUST treat load as tolerant of missing data (return Ok(None)) and SHOULD make save atomic — partial writes that survive a crash corrupt future comparisons.

scope is a free-form key the caller uses to namespace baselines. Implementations MUST treat (scope, name) as the identity of a baseline.

Required Methods§

Source

fn load(&self, scope: &str, name: &str) -> Result<Option<Baseline>>

Load a baseline if one exists for (scope, name).

Source

fn save(&self, scope: &str, baseline: &Baseline) -> Result<()>

Persist a baseline atomically under the given scope.

Implementors§