Expand description
ledvar-diff — the optional companion to the Ledvar core: how to
represent the comparison of two snapshots (DIFF.md).
The comparison itself is a forced consequence of the core’s hashes — match
nodes by identity_key, then classify by content_hash. This crate fixes
the shared vocabulary (StateStatus, DiffNode, DiffResult) so one
component can produce a result and another can read it. It is domain-blind.
use ledvar_diff::{diff, StateStatus};
let result = diff(None, &s()).unwrap(); // cold start
assert!(result.nodes.iter().all(|n| n.state_status == StateStatus::Baseline));Structs§
- Diff
Node - One node of a comparison result.
- Diff
Result - A computed comparison: the
currentsnapshot’s metadata plus the classified nodes.
Enums§
- State
Status - The relationship of a node to its prior state. Exhaustive and mutually exclusive: every node is exactly one, and there is no sixth case.
Functions§
- diff
- Compare
currentagainstprevious(or a cold start ifpreviousisNone).