Struct salt::router::Router [] [src]

pub struct Router { /* fields omitted */ }

Methods

impl Router
[src]

Construct a new, empty Router.

let router = Router::new();

Equivalent to Router::default().

Add a new route to a Router, matching both a Method and a Pattern. Any value that implements Into<Route> may be provided to route.

For example, to match a Get request to /users:

router.route((Method::Get, "/users", |_| {
    // [...]
}));

Trait Implementations

impl Default for Router
[src]

Returns the "default value" for a type. Read more

impl Handler for Router
[src]