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.
- Frame
Buffer - 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).