Trait ServiceHandler

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

服务的处理程序

Required Methods§

Source

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

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

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

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

§Examples
None::<()>;

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§