Trait Service
pub trait Service<Input>:
Sized
+ Send
+ Sync
+ 'static {
type Output: Send + 'static;
type Error: Send + 'static;
// Required method
fn serve(
&self,
input: Input,
) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send;
// Provided method
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error> { ... }
}Expand description
A Service that produces rama services,
to serve given an input, be it transport layer Inputs or application layer http requests,
or something else entirely.
Required Associated Types§
Required Methods§
Provided Methods§
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Box this service to allow for dynamic dispatch.
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.