Struct shio::router::Router [] [src]

pub struct Router { /* fields omitted */ }

Methods

impl Router
[src]

[src]

Construct a new, empty Router.

let router = Router::new();

Equivalent to Router::default().

[src]

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", |_| {
    // [...]
}));

[src]

Deprecated since 0.0.7

: use Router::add instead

[src]

Trait Implementations

impl Default for Router
[src]

[src]

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

impl Debug for Router
[src]

[src]

Formats the value using the given formatter.

impl Handler for Router
[src]

[src]

[src]