[][src]Struct reset_router::RouterBuilder

pub struct RouterBuilder<'a, S> { /* fields omitted */ }

Builder for a Router

Methods

impl<'a, S: 'static> RouterBuilder<'a, S>[src]

pub fn with_state<O>(self, state: O) -> RouterBuilder<'a, O>[src]

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

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

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

Method can be a http::Method or a bits::Method flag

pub fn add_with_priority<H, I>(
    self,
    method: I,
    regex: &'a str,
    priority: u8,
    handler: H
) -> Self where
    H: Into<BoxedHandler> + 'static,
    I: Into<MethodKind>, 
[src]

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

Method can be a http::Method or a bits::Method flag

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

Consumes the builder, returning the finished Router

Auto Trait Implementations

impl<'a, S> Send for RouterBuilder<'a, S> where
    S: Send

impl<'a, S> Unpin for RouterBuilder<'a, S> where
    S: Unpin

impl<'a, S> Sync for RouterBuilder<'a, S> where
    S: Sync

impl<'a, S> !UnwindSafe for RouterBuilder<'a, S>

impl<'a, S> !RefUnwindSafe for RouterBuilder<'a, S>

Blanket Implementations

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.

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

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

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

impl<T> Erased for T