Trait quic_rpc_utils::ServiceHandler

source ·
pub trait ServiceHandler<T: Service> {
    // Required method
    fn handle_rpc_request<S, E>(
        self: Arc<Self>,
        req: T::Req,
        chan: RpcChannel<S, E, T>,
        rt: &'static Runtime,
    ) -> impl Future<Output = Result<()>> + Send
       where E: ServiceEndpoint<S>,
             S: Service;
}
Expand description

服务的处理程序

Required Methods§

source

fn handle_rpc_request<S, E>( self: Arc<Self>, req: T::Req, chan: RpcChannel<S, E, T>, rt: &'static Runtime, ) -> impl Future<Output = Result<()>> + Send
where E: ServiceEndpoint<S>, S: Service,

用于服务端处理请求和响应。

§Arguments
  • req: 请求参数。
  • chan: 连接通道。
  • rt: 异步运行时。

returns: impl Future<Output=Result<(), Error>>+Send+Sized 是否处理成功。

§Examples
None

Object Safety§

This trait is not object safe.

Implementors§