Trait tonic::client::GrpcService[][src]

pub trait GrpcService<ReqBody> {
    type ResponseBody: Body + HttpBody;
    type Error: Into<Box<dyn Error + Send + Sync>>;
    type Future: Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>;
    fn poll_ready(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<(), Self::Error>>;
fn call(&mut self, request: Request<ReqBody>) -> Self::Future; }

Definition of the gRPC trait alias for tower_service.

This trait enforces that all tower services provided to Grpc implements the correct traits.

Associated Types

type ResponseBody: Body + HttpBody[src]

Responses body given by the service.

type Error: Into<Box<dyn Error + Send + Sync>>[src]

Errors produced by the service.

type Future: Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>[src]

The future response value.

Loading content...

Required methods

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>[src]

Returns Ready when the service is able to process requests.

Reference Service::poll_ready.

fn call(&mut self, request: Request<ReqBody>) -> Self::Future[src]

Process the request and return the response asynchronously.

Reference Service::call.

Loading content...

Implementors

impl GrpcService<BoxBody> for Channel[src]

type ResponseBody = Body

type Error = Error

type Future = ResponseFuture

impl<T, ReqBody, ResBody> GrpcService<ReqBody> for T where
    T: Service<Request<ReqBody>, Response = Response<ResBody>>,
    T::Error: Into<Box<dyn Error + Send + Sync>>,
    ResBody: Body + HttpBody,
    <ResBody as HttpBody>::Error: Into<Box<dyn Error + Send + Sync>>, 
[src]

type ResponseBody = ResBody

type Error = T::Error

type Future = T::Future

Loading content...