Skip to main content

apply

Function apply 

Source
pub fn apply<V: Clone + Eq, P: WritePast, O: WriteOracle>(
    state: &RowState<V>,
    write: &Write<V, P>,
    oracle: &O,
) -> Result<RowUpdate<V>, O::Error>
Expand description

Apply one write to one row (proofs/merge.md B5; Lean step). It touches only the supplied row. All past writes must be applied and the arriving write must be absent from the oracle. Call for each changed row against the same pre-write oracle, then commit all results in the database’s transaction. Parity, future generations, missing metadata and overflow are checked here. A nonzero generation needs a read at least as recent as its earliest recorded changer. That is the locally checkable part of assumption 3: the canonical record cannot tell whether another read write also reached the generation. The authoring database establishes the full witness when producing a change; test histories validate it explicitly. The input state is unchanged on every error path.