1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Compact, context-preserving diffs of structured data.
//!
//! `cool-diff` compares two [`serde_json::Value`] trees and produces a minimal,
//! human-readable diff. It is format-agnostic at the core and ships with a
//! YAML-style renderer ([`YamlRenderer`]) out of the box.
//!
//! # Quick start
//!
//! ```
//! use cool_diff::{diff, DiffConfig, DiffRenderer as _, YamlRenderer};
//!
//! let actual = serde_json::json!({
//! "server": {
//! "host": "0.0.0.0",
//! "port": 8080,
//! "tls": true,
//! }
//! });
//! let expected = serde_json::json!({
//! "server": {
//! "port": 3000,
//! }
//! });
//!
//! let tree = diff(&actual, &expected, &DiffConfig::default()).unwrap();
//!
//! if !tree.is_empty() {
//! let output = YamlRenderer::new().render(&tree);
//! print!("{output}");
//! }
//! ```
//!
//! # Array matching
//!
//! By default, arrays are compared by position (index). You can configure
//! per-path matching via [`MatchConfig`]:
//!
//! - [`ArrayMatchMode::Index`] - match by position (default)
//! - [`ArrayMatchMode::Key`] - match by a configured distinguished field
//! - [`ArrayMatchMode::Contains`] - find a matching element anywhere
//!
//! See [`DiffConfig`] and [`ArrayMatchConfig`] for configuration options.
/// Configuration types for the diff algorithm.
/// Core diff algorithm.
/// Data model for diff results.
/// Rendering diff trees as human-readable output.
pub use ;
pub use ;
pub use ;
pub use DiffRenderer;
pub use YamlRenderer;
pub use ColorMode;