pub trait Service<Request>:
Sized
+ Send
+ Sync
+ 'static {
type Response: Send + 'static;
type Error: Send + Sync + 'static;
// Required method
fn call(
&self,
request: Request,
) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send + '_;
// Provided method
fn boxed(self) -> BoxService<Request, Self::Response, Self::Error> { ... }
}
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
fn boxed(self) -> BoxService<Request, Self::Response, 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.