Skip to main content

Module seq

Module seq 

Source
Expand description

Positional diffing, behind the ordered field type.

A field marked #[delta_struct(field_type = "ordered")] is diffed with Myers’ algorithm and represented as a SeqDelta — a minimal edit script rather than the membership-only add/remove pair that unordered produces. Reach for it when a field’s order carries meaning and you would rather send two splices than the whole sequence.

The derive emits calls to diff and apply; you only need this module directly to inspect or construct a delta by hand.

Structs§

SeqDelta
A positional diff between two sequences: an ordered edit script.
Splice
One edit: drop remove items starting at at, then put insert in their place.

Functions§

apply
Applies an edit script to target in place.
diff
Computes a minimal edit script turning old into new.