Skip to main content

Module diff

Module diff 

Source
Expand description

Payload diff (issue #63): what changed between two consecutive values of one key.

For a keyspace-v2 state key this is the question — state is a LWW document, so “what moved” is what a reader actually wants, and re-reading two pretty-printed payloads side by side to find it is the thing explorers are supposed to save you from.

Two levels, and which one ran is never hidden:

  • diff over two structural values (crate::decode::structural_value) — named fields, added/removed/changed;
  • byte_diff when either side has no structural form (plain text, a protobuf frame, an opaque blob) — the honest fallback, reporting how much of the two byte strings is common rather than pretending to name fields.

Deliberately no notion of Put vs Delete: a tombstone is not a value and diffing it against one would be a category error. SampleView::kind is exact, and the frontend words the retirement.

Structs§

ByteDiff
What a byte comparison can honestly say when neither side is structural.
ValueDiff
The result of comparing two structural values.

Enums§

Change
One field-level difference, addressed by a dotted path (disk.used, items.0.name).

Functions§

byte_diff
Compare two payloads as bytes — the fallback when no structural form exists.
diff
Structurally compare two values, listing at most max_changes differences and counting the rest.