Skip to main content

Module mutation

Module mutation 

Source
Expand description

Mutation: checked edits to entities already in the model.

§Internal split

  • edit.rs: schema-agnostic edit operations (set_attribute, retype, truncate_attributes, remove) — the mutable counterpart to insert/push.

  • transaction.rs: preflight and atomic commit; truncations and the header are staged beside the edits, not as Edit variants.

  • conflict.rs: ID/reference/index conflict diagnostics.

  • step.rs: crate-private primitive writes stored as their own inverse.

  • record.rs: begin_recording / end_recording on Model.

  • inverse.rs: Inverse, the recorded undo of a run of writes.

  • history.rs: History, a bounded undo and redo stack of inverses.

  • preview.rs: Model::preview, a change that is always rolled back, revision included.

edit.rs, record.rs and preview.rs add inherent Model methods; transaction.rs owns the batched authoring contract. The public items are re-exported at the crate root.

Structs§

Applied
What a committed transaction did.
History
A bounded undo and redo history. See the module docs.
Inverse
The recorded undo of a run of writes. See the module docs.
Restored
The net effect of applying an Inverse.
Transaction
A batch of edits, validated together and applied as a unit.

Enums§

Conflict
A reason a transaction cannot be committed.
Edit
One staged change.
HistoryError
Why an undo or redo did not happen.
InverseError
Why an Inverse was not applied.