Skip to main content

Module batch

Module batch 

Source
Expand description

Binary framing of one staging batch: b"AVBU" | u16 version | u32 header_len | JSON header | record bytes.

Integers are big-endian. The header names each record’s slot and length; record bytes follow back to back in header order with nothing after them. Decoding checks every bound and length before handing out any record, so a server can refuse a malformed batch without touching storage.

Structs§

Batch
A decoded batch whose records borrow the request body.
Header
Slot

Constants§

CONTENT_TYPE
MAGIC
MAX_BYTES
Upper bound on one encoded batch. A single record of at most MAX_REQUEST_BYTES always fits.
MAX_HEADER
MAX_PAYLOAD
Upper bound on the sum of record lengths in one batch.
MAX_RECORDS
VERSION

Functions§

decode
encode
header_len
The encoded header length, or None if it exceeds MAX_HEADER.