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]
pub fn new(tree: Tree, response_finalizer: ResponseFinalizer) -> Router
[src]
: 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]
fn clone(&self) -> Router
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl NewHandler for Router
[src]
type Instance = Router
The type of Handler
created by the NewHandler
.
fn new_handler(&self) -> Result<Self::Instance>
[src]
Create and return a new Handler
value.