Module jsonrpsee_core::server::rpc_module
source · Expand description
JSON-RPC “modules” group sets of methods that belong together and handles method/subscription registration.
Structs
- Helper struct to manage subscriptions.
- Method callback wrapper that contains a sync or async closure, plus a table with resources it needs to claim to run
- Builder for configuring resources used by a method.
- Reference-counted, clone-on-write collection of synchronous and asynchronous methods.
- Sets of JSON-RPC methods can be organized into a “module“s that are in turn registered on the server or, alternatively, merged with other modules to construct a cohesive API.
RpcModule
wraps an additional context argument that can be used to access data during call execution. - Wrapper struct that maintains a subscription “mainly” for testing.
- Represents a single subscription.
Enums
- Outcome of a successful terminated subscription.
- Callback wrapper that can be either sync or async.
- Result of a method, either direct value or a future of one.
Type Definitions
- Similar to
SyncMethod
, but represents an asynchronous handler and takes an additional argument containing aResourceGuard
if configured. - Connection ID, used for stateful protocol such as WebSockets. For stateless protocols such as http it’s unused, so feel free to set it some hardcoded value.
- Max response size.
- Raw response from an RPC A 3-tuple containing:
- Method callback for subscriptions.
- A
MethodCallback
is an RPC endpoint, callable with a standard JSON-RPC request, implemented as a function pointer to aFn
function taking four arguments: theid
,params
, a channel the function uses to communicate the result (or error) back tojsonrpsee
, and the connection ID (useful for the websocket transport).