Struct gotham::router::Router [] [src]

pub struct Router { /* fields omitted */ }

Responsible for dispatching HTTP requests to defined routes, and responding with appropriate error codes when a valid Route is unable to be determined or the dispatch cannot be performed.

A Router is constructed through the gotham::router::builder API, and used with the gotham::start function when booting a Gotham web application.

The Router is capable of delegating requests to secondary Router instances, which allows the support of "modular applications". A modular application contains multiple applications within a single binary that have clear boundaries established via Rust module separation. Please see the documentation for DrawRoutes::delegate within gotham::router::builder in order to delegate to other Router instances.

Methods

impl Router
[src]

[src]

Deprecated since 0.2.0

: use the new gotham::router::builder API to construct a Router

Manually assembles a Router instance from a provided Tree.

Trait Implementations

impl Clone for Router
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl NewHandler for Router
[src]

The type of Handler created by the NewHandler.

[src]

Create and return a new Handler value.

impl Handler for Router
[src]

Important traits for Box<W>
[src]

Handles the Request by determining the correct Route from the internal Tree, storing any path related variables in State and dispatching to the associated Handler.

Auto Trait Implementations

impl Send for Router

impl Sync for Router