Struct tokio_http2::router::Router [] [src]

pub struct Router {
    pub routes: Vec<Route>,
}

This is the one. The router.

Fields

Methods

impl Router
[src]

Create a default Router.

Returns a newly created Router.

Finds handler for given Request.

This method uses default error handlers. If the request does not match any route than default 404 handler is returned. If the request match some routes but http method does not match (used GET but routes are defined for POST) than default method not supported handler is returned.

Finds handler for given Request.

It returns handler if it's found or StatusCode for error. This method may return NotFound, MethodNotAllowed or NotImplemented status codes.

Finds handler for given &str path.

It returns handler if it's found or StatusCode for error. This method may return NotFound, MethodNotAllowed or NotImplemented status codes.

Trait Implementations

impl Debug for Router
[src]

Formats the value using the given formatter.

impl Clone for Router
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more