Expand description
Core types and helpers for diff rendering.
This crate provides shared infrastructure for rendering diffs across different serialization formats (XML, JSON, TOML, etc.).
§Symbols
- deleted (red)
+ inserted (green)
← moved from here (blue)
→ moved to here (blue)§Value-only coloring
Keys/field names stay neutral, only the changed VALUES are colored:
- fill="red" ← "red" is red, "fill=" is white
+ fill="blue" ← "blue" is green, "fill=" is whiteRe-exports§
pub use layout::AnsiBackend;pub use layout::Attr;pub use layout::AttrStatus;pub use layout::BuildOptions;pub use layout::ChangedGroup;pub use layout::ColorBackend;pub use layout::DiffFlavor;pub use layout::ElementChange;pub use layout::FieldPresentation;pub use layout::FormatArena;pub use layout::FormattedValue;pub use layout::JsonFlavor;pub use layout::Layout;pub use layout::LayoutNode;pub use layout::PlainBackend;pub use layout::RenderOptions;pub use layout::RustFlavor;pub use layout::SemanticColor;pub use layout::Span;pub use layout::XmlFlavor;pub use layout::build_layout;pub use layout::group_changed_attrs;pub use layout::render;pub use layout::render_to_string;
Modules§
- layout
- Layout types and algorithms for diff rendering.
Structs§
- Diff
Symbols - Symbols for diff rendering.
- Diff
Theme - Color theme for diff rendering.
- Interspersed
- An interspersed sequence of A and B values. Pattern: [A?, (B, A)*, B?]
- Path
- A path from root to a node.
- Replace
Group - A group of values being replaced (removals paired with additions).
- Updates
- Sequence updates: update groups interspersed with unchanged items.
- Updates
Group - A group of updates containing replace groups interspersed with nested diffs.
Enums§
- Change
Kind - The kind of change for a diff element.
- Diff
- The difference between two values.
- Path
Segment - A path segment describing how to reach a child.
- Value
- A set of updates, additions, deletions, insertions etc. for a tuple or a struct