[][src]Trait izanami_http::service::HttpService

pub trait HttpService<RequestBody>: Sealed<RequestBody> where
    RequestBody: HttpBody
{ type ResponseBody: HttpBody; type Error; type Respond: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>; fn poll_ready(&mut self) -> Poll<(), Self::Error>;
fn respond(&mut self, request: Request<RequestBody>) -> Self::Respond; }

An asynchronous service that handles HTTP requests on a transport.

Associated Types

type ResponseBody: HttpBody

The type of HTTP response returned from respond.

type Error

The error type which will be returned from this service.

type Respond: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>

The future that handles an incoming HTTP request.

Loading content...

Required methods

fn poll_ready(&mut self) -> Poll<(), Self::Error>

Returns true when the service is ready to call respond.

fn respond(&mut self, request: Request<RequestBody>) -> Self::Respond

Handles an incoming HTTP request and returns its response asynchronously.

Loading content...

Implementors

impl<S, ReqBd, ResBd> HttpService<ReqBd> for S where
    S: Service<Request<ReqBd>, Response = Response<ResBd>>,
    ReqBd: HttpBody,
    ResBd: HttpBody
[src]

type ResponseBody = ResBd

type Error = S::Error

type Respond = S::Future

Loading content...