pub struct DiffSummary {
pub missing: Vec<String>,
pub modified: Vec<String>,
}Expand description
Detailed classification of every diff in a check-mode run.
missing collects the artifact paths that don’t exist on disk yet
(the caller would create them on the next aidoc_gen). modified
collects paths whose on-disk copy differs from the freshly
generated body. Paths that match on disk contribute to neither
list.
This is the shape returned by classify_diffs; both cargo aidoc --check and the MCP aidoc_check tool use it to produce a
consistent, actionable summary message via
DiffSummary::summary_message.
Fields§
§missing: Vec<String>Artifact paths (base-relative) that don’t exist on disk.
modified: Vec<String>Artifact paths (base-relative) whose on-disk bytes differ.
Implementations§
Source§impl DiffSummary
impl DiffSummary
Sourcepub fn paths(&self) -> impl Iterator<Item = &String>
pub fn paths(&self) -> impl Iterator<Item = &String>
Iterate every diff path in a stable order (all missing first, then all modified), matching the order they were discovered.
Sourcepub fn summary_message(&self, total_artifacts: usize) -> String
pub fn summary_message(&self, total_artifacts: usize) -> String
Actionable, human-readable summary of the check result. Callers pass the total artifact count so the clean-state message can state how many artifacts were compared.
The four branches:
- Clean —
"aidoc: check clean (N artifact(s))" - Only missing —
"aidoc: N artifact(s) not on disk yet — run aidoc_gen to write them". Triggers for both full uninit and partial uninit (e.g.docs/aidoc/exists but the error catalog subset was never written). - Only modified —
"aidoc: N artifact(s) content changed — run aidoc_gen to update" - Mixed —
"aidoc: N missing + M modified — run aidoc_gen"
Trait Implementations§
Source§impl Clone for DiffSummary
impl Clone for DiffSummary
Source§fn clone(&self) -> DiffSummary
fn clone(&self) -> DiffSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more