Skip to main content

Crate wscall_protocol

Crate wscall_protocol 

Source
Expand description

Shared protocol definitions for WSCALL.

This crate contains the transport envelope, frame codec, encryption modes, and inline attachment model used by both the server and client crates.

Structs§

ErrorPayload
Standard error payload embedded in API responses and event acknowledgements.
FileAttachment
Inline attachment carried alongside JSON params or event data.
FrameCodec
Encodes and decodes WSCALL binary frames.
PacketEnvelope
Full transport envelope before frame encoding.

Enums§

EncryptionKind
Selects how the payload section of a frame is encoded.
MessageType
Distinguishes API messages from event messages inside a WSCALL frame.
PacketBody
JSON-level message body transported inside a WSCALL frame.
ProtocolError
Errors returned while encoding or decoding WSCALL frames.

Constants§

K_API_REQUEST
Compact numeric tag identifying each PacketBody variant in the JSON wire format. Using a single-byte numeric field ("k": 0) instead of a string tag ("kind": "api_request") saves several bytes per frame.
K_API_RESPONSE
K_EVENT_ACK
K_EVENT_EMIT

Functions§

decode_frame
Helper for decoding a plaintext frame without constructing a custom codec.
encode_frame
Helper for encoding a plaintext frame without constructing a custom codec.