Struct hyper_router::RouterBuilder
[−]
[src]
pub struct RouterBuilder { /* fields omitted */ }
Builder for a router
Example usage:
Methods
impl RouterBuilder
[src]
pub fn new() -> RouterBuilder
[src]
pub fn add(self, route: Route) -> RouterBuilder
[src]
Adds new Route
for Router
that is being built.
Example:
ⓘThis example is not tested
use hyper::server::{Request, Response}; use hyper_router::{Route, RouterBuilder}; fn some_handler(_: Request) -> Response { // do something } RouterBuilder::new().add(Route::get(r"/person/\d+").using(some_handler));