Skip to main content

RpcHandler

Trait RpcHandler 

Source
pub trait RpcHandler: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: RpcRequest,
    ) -> Pin<Box<dyn Future<Output = RpcResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler trait for RPC methods

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: RpcRequest, ) -> Pin<Box<dyn Future<Output = RpcResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl RpcHandler for MethodRouter

Source§

impl<F> RpcHandler for FunctionHandler<F>
where F: Fn(RpcRequest) -> BoxFuture<'static, RpcResponse> + Send + Sync,

Source§

impl<TRequest, TResponse, H> RpcHandler for TypedRpcHandler<TRequest, TResponse, H>
where TRequest: for<'de> Deserialize<'de> + Message + Default + Send + 'static, TResponse: Serialize + Message + Send + 'static, H: TypedHandler<TRequest, TResponse>,