Skip to main content

encode_ops_record

Function encode_ops_record 

Source
pub fn encode_ops_record(
    shard_id: u32,
    lsn: u64,
    ops: &[Op],
    command_payload: Option<&[u8]>,
) -> Vec<u8> ⓘ
Expand description

Encode an expanded op-set as a framed WAL record at (shard_id, lsn), optionally paired with the serialized CommitBatch that produced it (carrying the command in the WAL record is what makes the command journal — commit_key per LSN — fully derivable from the WAL, closing the __log__ redb row that used to be the only source of it). command_payload is the batch pre-serialized by the caller (already computed once for the outcome-payload row), not re-serialized here.

§Panics

Panics if the op-set encodes to more than u32::MAX bytes, which the 64 MiB record ceiling makes impossible.