Skip to main content

Module server

Module server 

Source

Re-exportsยง

pub use builder::ServerBuilder;
pub use channel::Channel;
pub use pubsub_service::PubSubRPCMethod;
pub use pubsub_service::PubSubRPCService;
pub use service::RPCMethod;
pub use service::RPCService;

Modulesยง

acceptor ๐Ÿ”’
Acceptors used by the stream-based and WebSocket backends. Accepts a connection, wraps it with a codec, and hands the split halves to the server.
builder
channel
dispatch ๐Ÿ”’
Request sanity check and method dispatch.
http ๐Ÿ”’
HTTP server: HTTP/1.1 + HTTP/2 over TCP, optional HTTP/3 over QUIC.
pubsub_service
quic ๐Ÿ”’
QUIC transport: one request per stream, with separate notification streaming for pubsub.
service

Structsยง

Server
A JSON-RPC 2.0 server.
ServerConfig ๐Ÿ”’

Enumsยง

ServerBackend ๐Ÿ”’
One variant per backend family. Stream-based transports share a single AsyncAcceptor; QUIC and HTTP have their own loops.

Constantsยง

CHANNEL_SUBSCRIPTION_BUFFER_SIZE ๐Ÿ”’
FAILED_TO_PARSE_ERROR_MSG
INVALID_REQUEST_ERROR_MSG
METHOD_NOT_FOUND_ERROR_MSG
RESPONSE_QUEUE_SIZE ๐Ÿ”’
Bound on the per-connection outbound response queue.
UNSUPPORTED_JSONRPC_VERSION

Traitsยง

WsCodec
Bound on the WebSocket codec generic. With the ws feature it requires JsonRpcWsCodec; otherwise it accepts any clonable type (the codec is unused) so callers can pass JsonCodec unchanged.

Functionsยง

create_backend ๐Ÿ”’
request_task ๐Ÿ”’
stream_reader_task ๐Ÿ”’
stream_writer_task ๐Ÿ”’