Expand description
Diffs: an engine, terminal views and the inputs they read.
engine: Myers’ O(ND) diff in linear space over any hashable elements (diff_lines,diff_slices), word and character diffs for intra-line emphasis (diff_words,diff_chars),Hunkgrouping andTextDiff, whoseunifiedoutput matchesdiff -uminus timestamps.DiffView: a renderable diff, unified or side by side, of plain text, ANSI text (DiffView::ansi, which also reports style-only changes) or, with thetestingfeature, render snapshots.SourceDiff: a syntax-highlighted source diff with optional line links.git: agit diffparser andPatchView, a review-style renderer with a file tree, annotations and links.test_report(featuretest-report): JUnit XML and libtest JSON test results and theTestReportrenderable.assert_rich_eq!and friends (featuretesting): assertions that panic with a rendered diff.
With colour off every change stays visible: -, + and ~ (style only)
markers lead each changed line.
Re-exports§
pub use engine::diff_chars;pub use engine::diff_lines;pub use engine::diff_slices;pub use engine::diff_words;pub use engine::group_hunks;pub use engine::hunk_header;pub use engine::tokenize;pub use engine::Hunk;pub use engine::Op;pub use engine::TextDiff;
Modules§
- assert
- Assertions that fail with a rendered diff:
assert_rich_eq!,assert_rich_json_eq!,assert_render_eq!andassert_snapshot_eq!. - engine
- The diff engine: Myers’ O(ND) algorithm in linear space, hunk grouping,
token-level diffs for intra-line emphasis and the
diff -utext format. - git
git diffoutput: a parser and a review-style renderer.- test_
report - Test results: a format-neutral model, JUnit XML and libtest JSON
adapters, a renderable
TestReportand JUnit export. - transform
- Transforms over a parsed git
Patch, for aPipeline.
Structs§
- Diff
View - A line diff as a renderable: unified (default) or side by side, with line numbers, hunk headers and word-level emphasis on changed lines.
- Source
Diff - A syntax-highlighted diff of two versions of a source file.
Enums§
Constants§
- STYLES
- The default styles for diff and test-report keys.
extended_themeincludes them; renderers fall back to them when a theme lacks a key.