Skip to main content

encode_batch_payload

Function encode_batch_payload 

Source
pub fn encode_batch_payload(payloads: &[&[u8]]) -> Vec<u8> ⓘ
Expand description

Encode multiple payloads into a single batch-framed payload.

Layout:

[CXBT: 4 bytes]          — batch magic
[count: u32 le]          — number of sub-payloads
for each sub-payload:
  [len: u32 le]          — sub-payload length
  [data: len bytes]      — sub-payload data

This format is written as a single WAL record so the CRC covers the entire batch — either all sub-payloads survive or none (crash atomicity).