Skip to main content

Module wire

Module wire 

Source
Expand description

Mesh wire format of a forwarded inference request (frame types InferRequest 0x10 and InferResponse 0x11).

InferRequest   [ver u8][head_len u32 BE][head JSON][body bytes]
InferResponse  [kind u8][data]     kind 0 head (JSON {status, content_type})
                                   kind 1 chunk (raw bytes)
                                   kind 2 end
                                   kind 3 error (UTF-8 text)

The request carries no Authorization: the credentials of the client on one node are not forwarded to another. Everything decoded from the wire is revalidated as if it came from a client, because it came from a peer.

Enums§

Resp
One response frame.

Constants§

CHUNK_BYTES
Largest body chunk put in one response frame.
MAX_ROLE
Longest role name.
WIRE_VERSION
Wire version of InferRequest.

Functions§

decode_request
Decode and revalidate a request received from a peer.
decode_resp
Decode a response frame payload received from a peer.
encode_request
Encode a request for the mesh (without its Authorization).
encode_resp
Encode a response frame payload.