Expand description
Length-prefixed frame codec for reading and writing protocol messages.
Wire format: [len: u32 BE][id: u32 BE][flags: u8][CBOR(v, t, p)]
The correlation ID and flags sit in a fixed-position binary header so that relay intermediaries can route frames without CBOR parsing.
Constants§
- MAX_
FRAME_ SIZE - Maximum allowed frame size (4 MiB).
Functions§
- encode_
to_ buf - Encodes a message to a byte buffer using the length-prefixed frame format.
- read_
message - Reads a length-prefixed message from the given reader.
- try_
decode_ from_ buf - Tries to decode a complete message from a byte buffer.
- write_
message - Writes a length-prefixed message to the given writer.