pub trait Method<S, P, R>: Sealed {
    type Future: Future<Output = R> + Send;
    fn invoke(&self, server: S, params: P) -> Self::Future;
}
Expand description

A trait implemented by all valid JSON-RPC method handlers.

This trait abstracts over the following classes of functions and/or closures:

SignatureDescription
async fn f(&self) -> jsonrpc::Result<R>Request without parameters
async fn f(&self, params: P) -> jsonrpc::Result<R>Request with required parameters
async fn f(&self)Notification without parameters
async fn f(&self, params: P)Notification with parameters

Associated Types

The future response value.

Required methods

Invokes the method with the given server receiver and parameters.

Implementors

Support JSON-RPC methods with params.

Support parameter-less JSON-RPC methods.