ledvar-diff 0.1.0

Optional companion standard for the Ledvar protocol: representing the comparison (diff) of two snapshots.
Documentation
//! `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};
//! # use ledvar_core::Snapshot;
//! # fn s() -> Snapshot { serde_json::from_str(r#"{"protocol_version":"0.1.0","origin_id":"o","provider_name":"p","timestamp":0,"tree":[]}"#).unwrap() }
//! let result = diff(None, &s()).unwrap();  // cold start
//! assert!(result.nodes.iter().all(|n| n.state_status == StateStatus::Baseline));
//! ```

#![forbid(unsafe_code)]
#![warn(missing_docs)]

mod compare;
mod result;
mod status;

pub use compare::diff;
pub use result::{DiffNode, DiffResult};
pub use status::StateStatus;