Struct arc_reactor::Router [] [src]

pub struct Router { /* fields omitted */ }

The main router of you application that is supplied to the ArcReactor.

Methods

impl Router
[src]

[src]

construct a new Router.

[src]

Mount a routegroup on this router. It will apply the middlewares already mounted on the Router to all the routes on the RouteGroup

 let router = Router::new();
 router.get("/users", UserService); // this will match "/users"

let nestedgroup = RouteGroup::new("admin");
 // by nesting it on `router`, this will match "/admin/delete/user"
 let nestedgroup.get("/delete/user", DeleteService);

 router.group(nestedgroup);

[src]

mount a request middleware on this router

ensure that the request middleware is added before any routes on the router. the middleware only applies to the routes that are added after it has been mounted.

[src]

mount a reesponse middleware on this router

ensure that the request middleware is added before any routes on the router. the middleware only applies to the routes that are added after it has been mounted.

[src]

add a route and a ServiceHandler for a get request

[src]

add a route and a ServiceHandler for a post request

[src]

add a route and a ServiceHandler for a put request

[src]

add a route and a ServiceHandler for a patch request

[src]

add a route and a ServiceHandler for a delete request

[src]

add a 404 handler

Trait Implementations

impl ArcService for Router
[src]

Important traits for Box<W>
[src]

Auto Trait Implementations

impl Send for Router

impl Sync for Router