Skip to main content

Module codec

Module codec 

Source

Structs§

PoolEntry
PoolEntryRef
Zero-copy pool entry borrowing from the input buffer.
SchemaInfo
Schema info needed by the decoder: field types + has_timestamp flag.
WireTypeId
Type ID as it appears on the wire (u16 in schema/event frame headers). Assigned sequentially by the encoder; the decoder reads them from the stream.

Enums§

Frame
FrameRef
Zero-copy frame that borrows from the input buffer.

Constants§

HEADER_SIZE
MAGIC
MAX_TIMESTAMP_DELTA_NS
Maximum nanosecond delta that fits in a u24 (3 bytes).
TAG_EVENT
TAG_SCHEMA
TAG_STRING_POOL
TAG_TIMESTAMP_RESET
VERSION

Functions§

decode_frame
Decode a single frame starting at data. Returns (Frame, bytes_consumed).
decode_frame_ref
Decode a single frame without allocating owned data for field values.
decode_header
decode_u24_le
Decode a 3-byte little-endian u24 from data. Returns None if fewer than 3 bytes.
encode_event
Encode an event frame. If timestamp_delta_ns is Some, writes a u24 LE delta after the type_id (for schemas with has_timestamp = true).
encode_header
encode_schema
encode_string_pool
encode_u24_le
Encode a u32 value as 3-byte little-endian (u24). Caller must ensure value <= 0xFF_FFFF.