Crate facet_diff

Crate facet_diff 

Source
Expand description

§facet-diff

Coverage Status crates.io documentation MIT/Apache-2.0 licensed Discord

Provides diffing capabilities for Facet types.

§Sponsors

Thanks to all individual sponsors:

GitHub Sponsors Patreon

…along with corporate sponsors:

AWS Zed Depot

…without whom this work could not exist.

§Special thanks

The facet logo was drawn by Misiasart.

§License

Licensed under either of:

at your option.

Structs§

AnsiBackend
ANSI backend - emits ANSI escape codes for terminal colors.
BuildOptions
Options for building a layout from a diff.
DiffFormat
Configuration for diff formatting.
DiffOptions
Configuration options for diff computation
DiffReport
A reusable diff plus its original inputs, allowing rendering in different output styles.
DiffSymbols
Symbols for diff rendering.
DiffTheme
Color theme for diff rendering.
Interspersed
An interspersed sequence of A and B values. Pattern: [A?, (B, A)*, B?]
JsonFlavor
JSON-style output flavor (JSONC with comments for type names).
LeafChange
A single leaf-level change in a diff, with path information.
Matching
A bidirectional mapping between nodes in two trees.
MatchingConfig
Configuration for the matching algorithm.
NodeLabel
Label for a node (the actual value for leaves).
Path
A path from root to a node.
PlainBackend
Plain backend - no styling, just plain text.
RenderOptions
Options for rendering a layout.
ReplaceGroup
A group of values being replaced (removals paired with additions).
RustFlavor
Rust-style output flavor.
SimilarityResult
Result of computing similarity between two Peek values using tree diff.
Updates
Sequence updates: update groups interspersed with unchanged items.
UpdatesGroup
A group of updates containing replace groups interspersed with nested diffs.
XmlFlavor
XML-style output flavor.

Enums§

ChangeKind
The kind of change for a diff element.
Diff
The difference between two values.
EditOp
An edit operation in the diff.
LeafChangeKind
The kind of leaf change.
NodeKind
The kind of a node in the tree (for type-based matching).
PathSegment
A path segment describing how to reach a child.
Value
A set of updates, additions, deletions, insertions etc. for a tuple or a struct

Traits§

ColorBackend
A backend that decides how to render semantic colors.
DiffFlavor
A diff output flavor that knows how to format values and present fields.
FacetDiff
Extension trait that provides a diff method for Facet types

Functions§

build_layout
Build a Layout from a Diff.
build_tree
Build a cinereus tree from a Peek value.
collect_leaf_changes
Collect all leaf-level changes with their paths.
compute_element_similarity
Compute structural similarity between two Peek values using tree diff.
diff_new_peek
Computes the difference between two Peek values (backward compatibility wrapper)
diff_new_peek_with_options
Computes the difference between two Peek values with options
elements_are_similar
Check if two sequence elements should be paired based on structural similarity.
format_diff
Format the diff with the given configuration.
format_diff_compact
Format the diff in compact mode (path-based, no tree structure).
format_diff_compact_plain
Format the diff in compact mode without colors.
format_diff_default
Format the diff with default configuration.
render_to_string
Render a layout to a String.
tree_diff
Compute the tree diff between two Facet values.

Type Aliases§

FacetTree
A tree built from a Peek value, ready for diffing.