Skip to main content

Module codec

Module codec 

Source
Expand description

Binary frame format and wire encoding traits for conduit.

Every conduit message is framed with an 11-byte header followed by a variable-length payload. The Encode / Decode traits provide zero-copy-friendly serialisation for primitive types, byte vectors, and strings.

§Frame layout (11 bytes)

OffsetSizeFieldNotes
01versionAlways PROTOCOL_VERSION (1)
11reserved0=protocol (reserved for future use)
21msg_typeSee MsgType
34sequenceLE u32, monotonic counter
74payload_lenLE u32, byte length of trailing data

Structs§

FrameHeader
Parsed representation of the 11-byte frame header.

Enums§

MsgType
Message-type tag carried in the frame header.

Constants§

FRAME_HEADER_SIZE
Size of the binary frame header in bytes.
PROTOCOL_VERSION
Current protocol version written into every frame.

Traits§

Decode
Decode a value from a byte slice in conduit’s binary wire format.
Encode
Encode a value into a byte buffer in conduit’s binary wire format.

Functions§

frame_pack
Build a complete frame: header bytes followed by payload bytes.
frame_unpack
Split a complete frame into its header and payload slice.