[−][src]Trait tower_web::util::http::HttpService
An HTTP service
This is not intended to be implemented directly. Instead, it is a trait
alias of sorts, aliasing tower_service::Service
trait with http::Request
and http::Response
types.
Associated Types
type RequestBody: BufStream
Request payload.
type ResponseBody: BufStream
The HTTP response body type.
type Error
The service error type
type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>
The future response value.
Required methods
fn poll_http_ready(&mut self) -> Poll<(), Self::Error>
Returns Ready
when the service is able to process requests.
fn call_http(&mut self, request: Request<Self::RequestBody>) -> Self::Future
Process the request and return the response asynchronously.
Provided methods
fn lift(self) -> LiftService<Self> where
Self: Sized,
Self: Sized,
Wraps self
with LiftService
. This provides an implementation of
Service
for Self
.
Implementors
impl<T, B1, B2> HttpService for T where
T: Service<Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
[src]
T: Service<Request = Request<B1>, Response = Response<B2>>,
B1: BufStream,
B2: BufStream,
type RequestBody = B1
type ResponseBody = B2
type Error = T::Error
type Future = T::Future
fn poll_http_ready(&mut self) -> Poll<(), T::Error>
[src]
fn call_http(&mut self, request: Request<Self::RequestBody>) -> Self::Future
[src]
fn lift(self) -> LiftService<Self> where
Self: Sized,
[src]
Self: Sized,