[−][src]Struct reset_router::RouterBuilder
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]
H: Into<BoxedHandler> + 'static,
pub fn add<H, I>(self, method: I, regex: &'a str, handler: H) -> Self where
H: Into<BoxedHandler> + 'static,
I: Into<MethodKind>,
[src]
H: Into<BoxedHandler> + 'static,
I: Into<MethodKind>,
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]
self,
method: I,
regex: &'a str,
priority: u8,
handler: H
) -> Self where
H: Into<BoxedHandler> + 'static,
I: Into<MethodKind>,
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,
S: Send,
impl<'a, S> Unpin for RouterBuilder<'a, S> where
S: Unpin,
S: Unpin,
impl<'a, S> Sync for RouterBuilder<'a, S> where
S: Sync,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,