Skip to main content

Module contract

Module contract 

Source
Expand description

View/editor contracts and their open metadata record.

A view is an encoder in the codec sense: Value -> Scene. An editor is a decoder: (Value, Intent) -> Draft, then Draft -> operation. A lens pairs a view with an optional editor and carries an ExportRecord-style metadata record (LensMeta) describing what it claims and what it costs. The metadata is an open record, not a closed kernel enum: new lens kinds and fields ride along as data rather than forcing kernel changes.

Structs§

Draft
A pending edit over a value: the base, the proposed value, whether it may be committed, and any field-anchored diagnostics.
Lens
A registered lens: its metadata plus optional view and editor objects.
LensMeta
Open metadata describing a registered lens. Modelled on ExportRecord: a data record the dispatcher reads, never a closed kernel enum plus a parallel registry map.
Operation
A checked operation produced by an editor commit, ready to be submitted through realize (P7). For now it carries the operation in Expr form.

Enums§

LensKind
The role a lens plays. A lens of a given kind is only considered when a pane asks for that kind (a pane showing a value asks for View; an editing pane asks for Editor).

Traits§

Editor
An editor decoder: (Value, Intent) -> Draft, then Draft -> operation.
View
A view encoder: Value -> Scene. Views are pure: the same value and options yield the same Scene.