Skip to main content

Module segment

Module segment 

Source
Expand description

SSG2 rows segments (SPEC.md §5.2) and the §2.4 generated-row codec they embed. All structural decode failures are sync.invalid_request (§5.2 error-code rule); the column-table-vs-generated-schema comparison (sync.schema_mismatch) is the receiver’s job, not the codec’s.

Structs§

Column
RowsSegment
SegmentRow
One §5.2 row record: the row’s server_version (≥ 1) plus its values.

Enums§

ColumnType
Column type tags (§2.4) — unchanged from v1’s binary-table-v1 assignment.
ColumnValue
A decoded column value. Json keeps the raw string (round-trip fidelity).

Constants§

SSG2_FORMAT_VERSION
SSG2_MAGIC

Functions§

decode_row
Decode one row per the §2.4 row codec: null bitmap (LSB-first, byte i/8), then non-null values positionally in column order.
decode_rows_segment
Decode a complete SSG2 rows segment (§5.2). Structural validation only — exactly the closed §5.2 failure list, every failure sync.invalid_request.
encode_row
Encode one row canonically per §2.4.
encode_rows_segment
Canonically encode a rows segment (§5.2).

Type Aliases§

Row
One row: columns.len() slots, None = NULL.