pub trait RpcHandler {
type Request: RpcRequest;
// Required method
fn handle(
&self,
request: Self::Request,
info: RpcRequestInfo,
) -> impl Future<Output = <Self::Request as RpcRequest>::Response> + Send;
}Expand description
Trait defining a handler for RPC requests. These can registered with the IPC client and will be used to handle incoming RPC requests.
Required Associated Types§
Sourcetype Request: RpcRequest
type Request: RpcRequest
The request type that this handler can process.
Required Methods§
Sourcefn handle(
&self,
request: Self::Request,
info: RpcRequestInfo,
) -> impl Future<Output = <Self::Request as RpcRequest>::Response> + Send
fn handle( &self, request: Self::Request, info: RpcRequestInfo, ) -> impl Future<Output = <Self::Request as RpcRequest>::Response> + Send
Handle the request. Any errors that occur should be defined as part of the RpcRequest
type. info describes where the request came from, see RpcRequestInfo.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".