pub struct Router<R> { /* private fields */ }
Expand description
The router instance.
Note that a router does not implement Route. It only implement service.
Implementations
sourceimpl<R> Router<R>
impl<R> Router<R>
sourcepub fn route<F, T, P, U, E, Fut>(self, route: F) -> Router<Or<R, Func<F, P>>> where
R: Route<T, Response = U, Error = E>,
F: FnMut(T, P) -> Fut,
P: Param<T>,
E: From<Error>,
Fut: Future<Output = Result<U, E>>,
pub fn route<F, T, P, U, E, Fut>(self, route: F) -> Router<Or<R, Func<F, P>>> where
R: Route<T, Response = U, Error = E>,
F: FnMut(T, P) -> Fut,
P: Param<T>,
E: From<Error>,
Fut: Future<Output = Result<U, E>>,
Add new route to this router.
Trait Implementations
sourceimpl<R, T> Service<T> for Router<R> where
R: Service<T>,
impl<R, T> Service<T> for Router<R> where
R: Service<T>,
impl<R: Copy> Copy for Router<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for Router<R> where
R: RefUnwindSafe,
impl<R> Send for Router<R> where
R: Send,
impl<R> Sync for Router<R> where
R: Sync,
impl<R> Unpin for Router<R> where
R: Unpin,
impl<R> UnwindSafe for Router<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more