pub trait Service<S, Request>: Sized + Send + Sync + 'static {
type Response: Send + 'static;
type Error: Send + Sync + 'static;
// Required method
fn serve(
&self,
ctx: Context<S>,
req: Request
) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send + '_;
// Provided method
fn boxed(self) -> BoxService<S, Request, Self::Response, Self::Error> { ... }
}
Expand description
A Service
that produces rama services,
to serve requests with, be it transport layer requests or application layer requests.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn boxed(self) -> BoxService<S, Request, Self::Response, Self::Error>
fn boxed(self) -> BoxService<S, Request, Self::Response, Self::Error>
Box this service to allow for dynamic dispatch.
Object Safety§
This trait is not object safe.