facet-xml-diff
Diff-aware XML serialization—render structural diffs as readable XML.
Overview
This crate renders diffs between facet values as XML with visual diff markers. It shows what changed between two values in a format that's easy to read, with proper alignment, colored output, and collapsing of unchanged regions.
Example
use Facet;
use tree_diff;
let old = Rect ;
let new = Rect ;
let xml = diff_to_string?;
Output:
Features
- Diff markers:
←/→(or-/+) prefix lines to show old vs new values - Value-only coloring: Only the changed values are colored, not the whole line
- Alignment: Attributes align properly for readability
- Collapsing: Long runs of unchanged content are collapsed with
... - ANSI colors: Optional terminal colors for better visibility
Options
use ;
let options = DiffSerializeOptions ;
Use Cases
- Debugging configuration changes
- Displaying diffs in CLI tools
- Generating human-readable change logs
- Testing serialization by comparing expected vs actual output
Sponsors
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
Special thanks
The facet logo was drawn by Misiasart.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.