Expand description
Stream preamble: [0x57][kind][header_len varint][CBOR header].
Every unidirectional stream in both directions starts with this preamble. Parsing it is the first thing that touches hostile bytes, so it is the place where the header size cap is enforced — before any allocation.
Structs§
- Preamble
- A parsed stream preamble.
Enums§
- Frame
Kind - What a stream carries.
- Preamble
Error - Why a preamble was rejected.
Constants§
- MAGIC
- First byte of every weida stream: ASCII
W. - MAX_
PREAMBLE_ LEN - Longest possible preamble: magic, kind and an 8-byte varint.
Functions§
- encode_
frame - Builds a complete header-only frame: preamble followed by
header. - encode_
preamble - Appends a preamble for
header_lenbytes of header toout. - parse_
preamble - Parses a preamble from the front of
input. - preamble_
bytes - A preamble for
header_lenbytes of header, and how many of the returned bytes are it.