Expand description
§turul-rpc
Typed JSON-RPC 2.0 framework. Facade crate re-exporting the
turul-rpc-core, turul-rpc-jsonrpc, and turul-rpc-server
crates under stable paths that mirror the original
turul-mcp-json-rpc-server 0.3.x layout.
Most consumers should depend on this crate. Use the split crates
directly only when you need to avoid pulling in the async runtime
(depend on turul-rpc-core only) or want to write a transport on top
of the codec without the dispatcher (depend on turul-rpc-jsonrpc).
Modules§
- async
- Async dispatcher and handler trait. Mirrors the original
r#asyncmodule fromturul-mcp-json-rpc-server. - dispatch
- JSON-RPC 2.0 codec — parser, batch handling, response helpers.
- error
- error_
codes - Standard JSON-RPC 2.0 error codes.
- notification
- prelude
- Convenient re-exports of the most commonly used types.
- request
- response
- types
Structs§
- Json
RpcDispatcher - JSON-RPC method dispatcher with a typed domain-error type.
- Json
RpcError - JSON-RPC 2.0 error types and standard error codes. JSON-RPC Error response
- Json
RpcNotification - JSON-RPC notification message structure for fire-and-forget communications. A JSON-RPC notification (request without an id)
- Json
RpcRequest - JSON-RPC request structure with method and parameters. A JSON-RPC request
- Json
RpcSuccess Response - JSON-RPC response types: the §5 Response object union (
JsonRpcResponse) and the success-only struct (JsonRpcSuccessResponse). A successful JSON-RPC response object (JSON-RPC 2.0 §5, success case):{jsonrpc, id, result}. - Session
Context - Minimal session context for JSON-RPC handlers.
Enums§
- Json
RpcError Code - JSON-RPC 2.0 error types and standard error codes. JSON-RPC error codes
- Json
RpcMessage - Incoming message union (request | notification) produced by the parser.
Enum representing the inbound JSON-RPC messages a server parses:
a request or a notification. Responses are produced, not parsed here,
and live in
turul_rpc_core::response::JsonRpcResponse. - Json
RpcResponse - JSON-RPC response types: the §5 Response object union (
JsonRpcResponse) and the success-only struct (JsonRpcSuccessResponse). A JSON-RPC Response object (JSON-RPC 2.0 §5): success XOR error. - Json
RpcVersion - Core JSON-RPC types for version and request identification. JSON-RPC version
- Json
RpcWire Message - Bidirectional wire-message union (request | notification | response) — the
schema’s
JSONRPCMessage. Superset ofJsonRpcMessage; for clients and peers that read responses. Parse withparse_json_rpc_wire_message. Any single JSON-RPC 2.0 message read off the wire, in either direction. - Request
Id - Core JSON-RPC types for version and request identification. A uniquely identifying ID for a JSON-RPC request: a String, a Number, or Null.
- Request
Params - JSON-RPC request structure with method and parameters. Parameters for a JSON-RPC request
- Response
Result - JSON-RPC response types: the §5 Response object union (
JsonRpcResponse) and the success-only struct (JsonRpcSuccessResponse). Result data for a JSON-RPC response
Constants§
- JSONRPC_
VERSION - JSON-RPC 2.0 version constant.
Traits§
- Json
RpcHandler - Trait for handling JSON-RPC method calls.
Functions§
- parse_
json_ rpc_ wire_ message - Bidirectional wire-message union (request | notification | response) — the
schema’s
JSONRPCMessage. Superset ofJsonRpcMessage; for clients and peers that read responses. Parse withparse_json_rpc_wire_message. Parse a JSON string into aJsonRpcWireMessage.