Skip to main content

Module protocol

Module protocol 

Source
Expand description

Protocol module - wire format, framing, and frame types.

This module implements the binary protocol for the data plane:

  • 11-byte header encoding/decoding
  • Frame buffer for accumulating partial reads
  • Frame struct with typed accessors
  • Header pool for zero-allocation encoding

Re-exports§

pub use header_pool::encode_header_pooled;
pub use header_pool::with_header_pool;
pub use header_pool::HeaderPool;

Modules§

flags
Flag constants for the protocol.
header_pool
Header buffer pool for zero-allocation header encoding.

Structs§

Frame
A complete protocol frame.
FrameBuffer
Buffer for accumulating incoming bytes and extracting complete frames.
Header
Decoded header from wire format.

Constants§

ABORT_METHOD_ID
Reserved method ID for ABORT signal.
ABSOLUTE_MAX_PAYLOAD_SIZE
Absolute maximum payload size (~2 GB, max i32).
DEFAULT_MAX_PAYLOAD_SIZE
Default maximum payload size (1 GB).
HEADER_POOL_SIZE
Header pool size for ring buffer optimization.
HEADER_SIZE
Header size in bytes (fixed, exactly 11).
RESERVED_METHOD_ID
Reserved method ID (never use).

Functions§

build_frame
Build a complete frame as a single byte vector.
build_frame_parts
Build frame parts for scatter/gather I/O.
decode_header
Decode a header from bytes (standalone function).
encode_header
Encode a header to bytes (standalone function).
encode_header_into
Encode a header into an existing buffer (standalone function).
validate_header
Validate a header for protocol compliance (standalone function).