[][src]Trait tower_grpc::generic::client::GrpcService

pub trait GrpcService<ReqBody> {
    type ResponseBody: Body + HttpBody;
    type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>;
    type Error: Into<Box<dyn Error + Send + Sync>>;
    fn poll_ready(&mut self) -> Poll<(), Self::Error>;
fn call(&mut self, request: Request<ReqBody>) -> Self::Future; fn into_service(self) -> IntoService<Self>
    where
        Self: Sized
, { ... }
fn as_service(&mut self) -> AsService<Self>
    where
        Self: Sized
, { ... } }

A specialization of tower_service::Service.

Existing tower_service::Service implementations with the correct form will automatically implement GrpcService.

Associated Types

type ResponseBody: Body + HttpBody

Response body type

type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>

Response future

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

Error type

Loading content...

Required methods

fn poll_ready(&mut self) -> Poll<(), Self::Error>

Poll that this service is ready.

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

Call the service.

Loading content...

Provided methods

fn into_service(self) -> IntoService<Self> where
    Self: Sized

Helper when needing to pass this type to bounds needing Service.

fn as_service(&mut self) -> AsService<Self> where
    Self: Sized

Helper when needing to pass this type to bounds needing Service.

Loading content...

Implementors

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
[src]

type ResponseBody = ResBody

type Future = T::Future

type Error = T::Error

fn into_service(self) -> IntoService<Self> where
    Self: Sized
[src]

fn as_service(&mut self) -> AsService<Self> where
    Self: Sized
[src]

Loading content...