pub trait HttpService {
type Error;
type ResBody: Body;
// Required method
fn call(
&mut self,
req: IncomingRequest,
) -> impl Future<Output = Result<Response<Self::ResBody>, Self::Error>> + Send;
}
Expand description
A trait representing an HTTP service.
This trait must be used in combination with HttpServiceFactory
.
It is very similar to tower’s service trait and implemented
for all types that implement tower::Service<IncomingRequest>
.
Required Associated Types§
Required Methods§
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.
Implementors§
Source§impl<F, Fut, E, B> HttpService for FnHttpService<F>
impl<F, Fut, E, B> HttpService for FnHttpService<F>
Source§impl<T, B> HttpService for T
Available on crate feature tower
only.
impl<T, B> HttpService for T
Available on crate feature
tower
only.