Skip to main content

WIRE_V1_MAGIC

Constant WIRE_V1_MAGIC 

Source
pub const WIRE_V1_MAGIC: u8 = 0xF5;
Expand description

Magic/version byte prefixed to every wire-format-v1 binary frame.

Drawn from 0xF5..=0xFF: these are invalid UTF-8 leading bytes and cannot begin a JSON document, so a decoder tells a binary frame from the legacy JSON encoding (which always starts with { = 0x7B) by inspecting one byte, with no negotiation. Future breaking revisions take the next value (0xF6 = v2, …), leaving room for eleven wire versions before the range is exhausted.