pub trait ReviewStore {
// Required methods
fn save_plan(&self, hash: &str, json: &str) -> Result<(), EngineError>;
fn load_state(&self) -> Result<ReviewState, EngineError>;
fn save_state(&self, state: &ReviewState) -> Result<(), EngineError>;
fn load_findings(&self) -> Result<Vec<Finding>, EngineError>;
fn save_findings(&self, findings: &[Finding]) -> Result<(), EngineError>;
}Expand description
One review’s sidecar (ADR 0013).
Every read is total: a store that has never been written yields defaults,
never an error. ReviewSession is write-through — every mutator saves
before returning — so an implementation must be cheap enough for that, and
crash-safe in the sense that matters here: a torn write loses at most the
last action.
Required Methods§
Sourcefn save_plan(&self, hash: &str, json: &str) -> Result<(), EngineError>
fn save_plan(&self, hash: &str, json: &str) -> Result<(), EngineError>
Persist a plan document under its content hash and point current at
it. Idempotent: re-saving the same hash must not rewrite the body.
Takes serialised JSON and the hash rather than a PlanDocument,
which keeps schema out of this module entirely — the frozen contract
stays frozen (ADR 0008, 0018).
fn load_state(&self) -> Result<ReviewState, EngineError>
fn save_state(&self, state: &ReviewState) -> Result<(), EngineError>
fn load_findings(&self) -> Result<Vec<Finding>, EngineError>
Sourcefn save_findings(&self, findings: &[Finding]) -> Result<(), EngineError>
fn save_findings(&self, findings: &[Finding]) -> Result<(), EngineError>
Rewrites the whole set (status changes, deletions, re-anchor results). The set is small; simplicity beats cleverness.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".