pub trait RpcHandler:
Send
+ Sync
+ 'static {
// Provided methods
fn handle<'life0, 'async_trait>(
&'life0 self,
method: Method,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn healthz<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn version(&self) -> String { ... }
}Expand description
The node behind the RPC server.
Implemented by the DIG node; consumed by RpcServer.
Provided Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
method: Method,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
method: Method,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a resolved method call, returning a result value or a canonical
error. params is the raw JSON-RPC params (Null when absent) — the
handler deserializes it into the method’s params type from
dig_rpc_protocol::types.
The default implementation rejects every method with -32601, so a
handler need only override the methods it actually serves (its profile).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".