pub trait Method<S, P, R>: Sealed {
type Future: Future<Output = R> + Send;
// Required method
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:
Signature | Description |
---|---|
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 |