[][src]Struct nickel::router::router::Router

pub struct Router<D = ()> { /* fields omitted */ }

The Router's job is it to hold routes and to resolve them later against concrete URLs. The router is also a regular middleware and needs to be added to the middleware stack with server.utilize(router).

Methods

impl<D> Router<D>
[src]

pub fn new() -> Router<D>
[src]

pub fn match_route<'mw>(
    &'mw self,
    method: &Method,
    path: &str
) -> Option<RouteResult<'mw, D>>
[src]

Trait Implementations

impl<D> HttpRouter<D> for Router<D>
[src]

fn get<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific GET request. Handlers are assigned to paths and paths are allowed to contain variables and wildcards. Read more

fn post<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific POST request. Read more

fn put<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific PUT request. Read more

fn delete<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific DELETE request. Read more

fn options<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific OPTIONS request. Read more

fn patch<M: Into<Matcher>, H: Middleware<D>>(
    &mut self,
    matcher: M,
    handler: H
) -> &mut Self
[src]

Registers a handler to be used for a specific PATCH request. Read more

impl<D: 'static> Middleware<D> for Router<D>
[src]

Auto Trait Implementations

impl<D> Send for Router<D>

impl<D> Sync for Router<D>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any