[][src]Struct reset_router::RouterBuilder

pub struct RouterBuilder { /* fields omitted */ }

Builder for a Router

Methods

impl RouterBuilder[src]

pub fn data<T: Send + Sync + 'static>(self, data: T) -> Self[src]

Add application data to router

pub fn wrapped_data<T: Send + Sync + 'static>(self, data: Data<T>) -> Self[src]

Add application data to router from an existing Data<T> object

pub fn add_not_found<H>(self, handler: H) -> Self where
    H: Into<BoxedServiceFn> + 'static, 
[src]

Set the 404: Not Found handler

pub fn add<H>(self, method: Method, regex: &str, handler: H) -> Self where
    H: Into<BoxedServiceFn> + 'static, 
[src]

Add handler for method and regex. Highest priority wins. Priority is 0 by default.

pub fn add_with_priority<H>(
    self,
    method: Method,
    regex: &str,
    priority: i8,
    handler: H
) -> Self where
    H: Into<BoxedServiceFn> + 'static, 
[src]

Add handler for method, regex, and priority. Highest priority wins.

pub fn finish(self) -> Result<Router>[src]

Consumes the builder, returning the finished Router

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.