Type Alias Router

Source
pub type Router = Router<Method, Handler>;
Expand description

The router type, tied to Hyper’s types, and our Handler. This implements [hyper::serivce::Service] by default, and if no default handler is given, it returns an empty 404 response.

Aliased Type§

pub struct Router { /* private fields */ }

Trait Implementations§

Source§

impl Service for Router

Source§

type ReqBody = Body

The Payload body of the http::Request.
Source§

type ResBody = Body

The Payload body of the http::Response.
Source§

type Error = Compat<Error>

The error type that can occur within this Service. Read more
Source§

type Future = Box<dyn Future<Item = Response<Body>, Error = Compat<Error>> + Send>

The Future returned by this Service.
Source§

fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future

Calls this Service with a request, returning a Future of the response.
Source§

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

Returns Ready when the service is able to process requests. Read more