Minga.RenderModel.Window.RowDelta (Minga v0.1.0)

Copy Markdown View Source

A validated row-sequence transition expressed in immutable-base coordinates.

The current renderer can derive one prefix/suffix splice from two snapshots via from_snapshots/2. Ticket #2742 can replace that derivation with ChangeLog-owned splices without changing the encoder or frontend wire contract.

Summary

Functions

Derives the temporary single prefix/suffix splice used before #2742 supplies ChangeLog deltas.

Builds and validates a row delta.

Validates immutable-base ordering, ranges, and exact result arithmetic.

Types

t()

@type t() :: %Minga.RenderModel.Window.RowDelta{
  base_row_count: non_neg_integer(),
  result_row_count: non_neg_integer(),
  splices: [Minga.RenderModel.Window.RowSplice.t()]
}

validation_error()

@type validation_error() ::
  :count_out_of_range
  | :empty_splice
  | :splice_out_of_range
  | :splices_not_strictly_ascending
  | :splices_overlap
  | :result_count_mismatch

Functions

from_snapshots(base_rows, result_rows)

@spec from_snapshots([Minga.RenderModel.Window.Row.t()], [
  Minga.RenderModel.Window.Row.t()
]) :: t()

Derives the temporary single prefix/suffix splice used before #2742 supplies ChangeLog deltas.

new(base_row_count, result_row_count, splices)

Builds and validates a row delta.

validate(delta)

@spec validate(t()) :: :ok | {:error, validation_error()}

Validates immutable-base ordering, ranges, and exact result arithmetic.