Skip to main content

roundtrip_holds

Function roundtrip_holds 

Source
pub fn roundtrip_holds(
    cx: &mut Cx,
    codec: &dyn SurfaceCodec,
    value: &Expr,
) -> Result<bool>
Expand description

Verifies the reversibility property for codec and value with a REAL edit.

Decodes an edit-field that sets the value to a distinct sentinel; the property holds when the resulting Draft is committable, actually proposes that sentinel (so an editor that drops the edit fails), and commits to an Operation. This is not a tautology: a lossy editor that re-proposes the base returns false. noop_roundtrip_holds keeps the weaker no-op check.