Trait GrpcService
pub trait GrpcService<ReqBody>:
Send
+ Sync
+ 'static {
type ResponseBody: Body;
type Error: Into<Box<dyn Error + Sync + Send>>;
// Required method
fn serve(
&self,
request: Request<ReqBody>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>;
}Expand description
Required Associated Types§
type ResponseBody: Body
type ResponseBody: Body
Responses body given by the service.
Required Methods§
fn serve(
&self,
request: Request<ReqBody>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>
fn serve( &self, request: Request<ReqBody>, ) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>>
Process the request and return the response asynchronously.
Reference Service::serve.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.