Esc

frame_message

procedureextensionsince 0.36.1Source
  • macOS: frame_message works on macOS
  • Linux: frame_message works on Linux
  • Windows: frame_message works on Windows
  • Wasm: frame_message works on Wasm

Encodes an envelope into caller-owned memory, freed with free(bytes.data).

Signature

frame_message :: (
    message: [] u8,
    max_message := 4 * 1024 * 1024,
    compression := Compression.IDENTITY,
    max_wire_message := 4 * 1024 * 1024
) -> ([] u8, Wire_Error)
Example↗
bytes, failure := frame_message(u8.[1, 2]);
assert(failure == .NONE && bytes.count == 7);
free(bytes.data);

See also