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

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

Responses body given by the service.

type Error: Into<Box<dyn Error + Send + Sync>>

Errors produced by the service.

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

The future response value.

Loading content...

Required methods

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.

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

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...