Trait jsonrpsee_server::middleware::rpc::RpcServiceT

source ·
pub trait RpcServiceT<'a> {
    type Future: Future<Output = MethodResponse> + Send;

    // Required method
    fn call(&self, request: Request<'a>) -> Self::Future;
}
Expand description

Similar to the tower::Service but specific for jsonrpsee and doesn’t requires &mut self for performance reasons.

Required Associated Types§

source

type Future: Future<Output = MethodResponse> + Send

The future response value.

Required Methods§

source

fn call(&self, request: Request<'a>) -> Self::Future

Process a single JSON-RPC call it may be a subscription or regular call. In this interface they are treated in the same way but it’s possible to distinguish those based on the MethodResponse.

Implementors§

source§

impl<'a> RpcServiceT<'a> for RpcService

§

type Future = ResponseFuture<Pin<Box<dyn Future<Output = MethodResponse> + Send + 'a>>>

source§

impl<'a, A, B> RpcServiceT<'a> for Either<A, B>
where A: RpcServiceT<'a> + Send + 'a, B: RpcServiceT<'a> + Send + 'a,

§

type Future = Either<<A as RpcServiceT<'a>>::Future, <B as RpcServiceT<'a>>::Future>

source§

impl<'a, S> RpcServiceT<'a> for RpcLogger<S>
where S: RpcServiceT<'a>,