Skip to main content

Module variant

Module variant 

Source
Expand description

The delta of a value that might have changed shape, and the failure that comes with it.

A struct’s delta always fits the value it is applied to: the fields are the fields, and nothing about them can disagree. An enum’s cannot. Two values of the same enum may be in different variants, in which case there is no difference to describe — only a replacement — and a delta built for one variant may arrive at a value sitting in another.

EnumDelta is the first half of that: one arm for “same variant, here is what changed inside it” and one for “different variant, here is the whole thing”. Mismatch is the second: what Delta::apply_delta returns when the two disagree.

Structs§

Mismatch
A delta that does not fit the value it was applied to.

Enums§

EnumDelta
The delta of an enum: a change within a variant, or a change of variant.