Skip to main content

encode_frame

Function encode_frame 

Source
pub fn encode_frame(
    type: u32,
    message_id: u64,
    payload: &[u8],
    out: &mut Vec<u8>,
)
Expand description

Encode a frame: writes HEADER_LEN + payload.len() bytes into out (preallocates / extends as needed).

ยงPanics

Panics if HEADER_LEN + payload.len() does not fit in a u32 (i.e. the payload is ~4 GiB). Real GCS messages are bounded by MAX_PAYLOAD_LEN (4 MiB), so this is a programmer-error guard rather than a runtime path.