Skip to main content

Module codec

Module codec 

Source
Expand description

JSON codec for JSON-RPC message framing.

Provides JsonCodec which encodes/decodes serde_json::Value messages with a configurable max payload size (default 4MB).

Structsยง

JsonCodec
Default JSON codec with configurable max payload size.

Constantsยง

DEFAULT_CONTENT_TYPE ๐Ÿ”’
Default HTTP Content-Type, for the default JsonCodec.
DEFAULT_MAX_BUFFER_SIZE ๐Ÿ”’

Traitsยง

Codec
Encodes and decodes messages from a wire-level type.
JsonRpcCodec
Byte-stream codec used for TCP, TLS, Unix, QUIC, and HTTP.
JsonRpcWsCodec
WebSocket-message codec used for ws:// and wss:// endpoints.

Functionsยง

decode_body ๐Ÿ”’
Decode one message from a complete HTTP body.
encode_msg ๐Ÿ”’
Encode one message with codec.
extend_buf ๐Ÿ”’
Append all bytes of data to buf.

Type Aliasesยง

ByteBuffer
Back-compat alias used as the wire type in Codec<W> for byte-stream framing.