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)
| Offset | Size | Field | Notes |
|---|---|---|---|
| 0 | 1 | version | Always PROTOCOL_VERSION (1) |
| 1 | 1 | reserved | 0=protocol (reserved for future use) |
| 2 | 1 | msg_type | See MsgType |
| 3 | 4 | sequence | LE u32, monotonic counter |
| 7 | 4 | payload_len | LE u32, byte length of trailing data |
Structs§
- Frame
Header - 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.