[][src]Struct roa::router::Router

pub struct Router<S> { /* fields omitted */ }
This is supported on feature="router" only.

A builder of RouteTable.

Methods

impl<S> Router<S> where
    S: 'static, 
[src]

pub fn new() -> Self[src]

This is supported on feature="router" only.

Construct a new router.

pub fn on(
    self,
    path: &'static str,
    endpoint: impl for<'a> Endpoint<'a, S>
) -> Self
[src]

This is supported on feature="router" only.

Register a new endpoint.

pub fn include(self, prefix: &'static str, router: Router<S>) -> Self[src]

This is supported on feature="router" only.

Include another router with prefix.

pub fn gate(self, next: impl for<'a> Middleware<'a, S>) -> Router<S>[src]

This is supported on feature="router" only.

Chain a middleware to Router::middleware.

pub fn routes(
    self,
    prefix: &'static str
) -> StdResult<RouteTable<S>, RouterError>
[src]

This is supported on feature="router" only.

Build RouteTable with path prefix.

Trait Implementations

impl<S> Default for Router<S> where
    S: 'static, 
[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for Router<S>

impl<S> Send for Router<S>

impl<S> Sync for Router<S>

impl<S> Unpin for Router<S>

impl<S> !UnwindSafe for Router<S>

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> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,