Expand description
§alux-jsonrpc-jsonrpsee
alux-jsonrpc-jsonrpsee interprets an alux-jsonrpc program as a
jsonrpsee method collection. The interpreter owns parameter decoding,
method registration, context sharing, serialization, and boundary error conversion.
use alux_jsonrpc::JsonRpcProgramExt;
use alux_jsonrpc_jsonrpsee::JsonrpseeImpl;
let rpc = JsonrpseeImpl::new(App::new());
let methods = rpc.compile_jsonrpc(rpc.status_rpc::<App>())?;A method marked fallible — with .fallible(), or by the fallible attribute on its ext — converts its
error into a protocol error, so the interpreter needs RpcErrorAlg for that error and builds the
ErrorObject itself. Every other method answers with any value serde can serialize.
RpcCtx carries a semantic context when a native #[rpc(server)] trait is implemented instead, and
ResultToRpcExt and RpcErrorExt convert semantic errors at the boundary. A shared scenario in tests/ runs one
expectation against both the specification-first program and a native jsonrpsee service.
Interprets typed JSON-RPC programs as jsonrpsee method collections.
The interpretation owns parameter decoding, method registration, context sharing, serialization, and boundary error conversion. Those are jsonrpsee mechanics rather than JSON-RPC program meaning, so the program compiled here is the same value any other interpreter folds.
Structs§
- Jsonrpsee
Impl - Interprets typed JSON-RPC programs as
jsonrpseemethod collections. - RpcCtx
- Carries a semantic context while interpreting it as a JSON-RPC service.
Traits§
- Into
RpcMethods Ext - Provides fallible composition of independently declared JSON-RPC methods.
- Jsonrpsee
Args - Parses the parameter product consumed by a JSON-RPC operation.
- Result
ToRpc Ext - Converts semantic results into JSON-RPC boundary results.
- RpcError
Ext - Reads a domain failure as the JSON-RPC error it denotes.
Functions§
- internal_
rpc_ error - Constructs an internal JSON-RPC error without implementation-specific data.
- rpc_
error - Constructs an owned JSON-RPC error.