Trait tonic::client::GrpcService
source · pub trait GrpcService<ReqBody> {
type ResponseBody: Body;
type Error: Into<Box<dyn Error + Send + Sync>>;
type Future: Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>;
// Required methods
fn poll_ready(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>;
fn call(&mut self, request: Request<ReqBody>) -> Self::Future;
}
Expand description
Definition of the gRPC trait alias for tower_service
.
This trait enforces that all tower services provided to Grpc
implements
the correct traits.
Required Associated Types§
sourcetype ResponseBody: Body
type ResponseBody: Body
Responses body given by the service.
Required Methods§
sourcefn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns Ready
when the service is able to process requests.
Reference Service::poll_ready
.
sourcefn call(&mut self, request: Request<ReqBody>) -> Self::Future
fn call(&mut self, request: Request<ReqBody>) -> Self::Future
Process the request and return the response asynchronously.
Reference Service::call
.