Skip to content

Function envelope::parse_command

zaun_community_protocol::envelope::parse_command · Function

pub fn parse_command(text: &str, negotiated: Option<u16>) -> Result<CommandEnvelope, Rejection>

Parses a whole or reassembled command envelope text.

negotiated is the connection’s negotiated version, None before a successful session.hello.

A Rejection with BAD_REQUEST (malformed JSON, missing or ill-typed field, bad id encoding, request_id: null outside signal.*), UNSUPPORTED_VERSION or PAYLOAD_TOO_LARGE.

Full rustdoc page