Trait cuprate_rpc_interface::RpcService
source · pub trait RpcService<Request, Response>:
Clone
+ Send
+ Sync
+ 'static
+ Service<Request, Response = Response, Error = Error, Future: Future<Output = Result<Response, Error>> + Send + 'static> { }
Expand description
An RPC tower::Service
.
This trait solely exists to encapsulate the traits needed to handle RPC requests and respond with responses - it is not meant to be used directly.
The Request
and Response
are generic and
are used in the tower::Service
bounds.
The error type is always anyhow::Error
.
There is a blanket implementation that implements this
trait on types that implement tower::Service
correctly.
See RpcHandler
for more information.
Object Safety§
This trait is not object safe.