Struct hyper_router::RouterBuilder [] [src]

pub struct RouterBuilder {
    // some fields omitted
}

Builder for a router

Example usage:

Methods

impl RouterBuilder

fn new() -> RouterBuilder

fn add(self, route: Route) -> RouterBuilder

Adds new Route for Router that is being built.

Example:

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));

fn build(self) -> Router

Trait Implementations

Derived Implementations

impl Debug for RouterBuilder

fn fmt(&self, __arg_0: &mut Formatter) -> Result