Please tell me about working with the grpc crate. The question is how to handle server-side rpc calls in an asynchronous manner. The handlers that protoc generates are as follows:
fn some_func(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle<super::cpth::CheckImgCaptchaRequest>, resp: ::grpc::ServerResponseUnarySink<super::cpth::CheckImgCaptchaResponse>) -> ::grpc::Result<()>;
It implies that the grpc :: Result type is returned. As far as I understand, based on the library documentation and questions on GitHub, there is some way to bring this type to Future, providing possibly asynchronous request processing as implemented in most server libraries, such as hyper, json-rpc, actix-web, etc. But I do not understand how this can be achieved.
fn some_func(&self, _: ServerHandlerContext, _req: ServerRequestSingle<CheckImgCaptchaRequest>, resp: ServerResponseUnarySink<CheckImgCaptchaResponse>) -> ::grpc::Result<()> {
r.result = true;
resp.finish(r)
//How to complete this call with Future insead of resp.finish(r)???
}