Skip to main content

Module entry

Module entry 

Source
Expand description

Keyed membership diffing, behind the unordered field type when the field is a map.

A map is a bag of entries, but a bag with a rule that the plain bag knows nothing about: no two entries share a key. That rule is what makes an EntryDelta the right shape for one — a bare key is enough to say an entry left, and a value is enough to say what a key holds now, because putting one back cannot leave the old one standing beside it.

Values are compared with == and replaced wholesale, which is the whole of what separates this from map: reach for unordered-delta and a MapDelta when the values are big enough to be worth diffing and implement Delta so they can be.

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

Structs§

EntryDelta
A membership diff between two collections of key/value entries.

Functions§

apply
Applies a keyed membership diff to target in place.
diff
Pairs the entries of old and new by key and records what the keys that survived hold now.