Skip to main content

Crate ledvar_diff

Crate ledvar_diff 

Source
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§

DiffNode
One node of a comparison result.
DiffResult
A computed comparison: the current snapshot’s metadata plus the classified nodes.

Enums§

StateStatus
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 current against previous (or a cold start if previous is None).