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>>;
// Required methods
fn poll_ready(&mut self) -> Poll<(), Self::Error>;
fn call(&mut self, request: Request<ReqBody>) -> Self::Future;
// Provided methods
fn into_service(self) -> IntoService<Self>
where Self: Sized { ... }
fn as_service(&mut self) -> AsService<'_, Self>
where Self: Sized { ... }
}Expand description
A specialization of tower_service::Service.
Existing tower_service::Service implementations with the correct form will
automatically implement GrpcService.
Required Associated Types§
Sourcetype ResponseBody: Body + HttpBody
type ResponseBody: Body + HttpBody
Response body type
Required Methods§
Sourcefn poll_ready(&mut self) -> Poll<(), Self::Error>
fn poll_ready(&mut self) -> Poll<(), Self::Error>
Poll that this service is ready.
Provided Methods§
Sourcefn into_service(self) -> IntoService<Self>where
Self: Sized,
fn into_service(self) -> IntoService<Self>where
Self: Sized,
Helper when needing to pass this type to bounds needing Service.
Sourcefn as_service(&mut self) -> AsService<'_, Self>where
Self: Sized,
fn as_service(&mut self) -> AsService<'_, Self>where
Self: Sized,
Helper when needing to pass this type to bounds needing Service.