Struct arc_reactor::routing::Router[][src]

pub struct Router { /* fields omitted */ }

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

Methods

impl Router
[src]

Construct a new Router.

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

This example is not tested
 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);

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.

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.

Add a route and a ServiceHandler for a GET request.

Add a route and a Service for a POST request.

mount a Service as well as a MiddleWare for a POST request

mount a Service as well as a MiddleWare and MiddleWare for a POST request

mount a Service as well as a MiddleWare for a POST request

add a route and a ServiceHandler for a put request

Add a route and a ServiceHandler for a PATCH request.

Add a route and a ServiceHandler for DELETE request.

Add a 404 handler.

Trait Implementations

impl Clone for Router
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl ArcService for Router
[src]

Auto Trait Implementations

impl Send for Router

impl Sync for Router