pub struct Router<S = ()> { /* private fields */ }Implementations§
source§impl<S> Router<S>
impl<S> Router<S>
pub fn new() -> Self
pub fn route<R>(self, uri: R, route: MethodRouter<S>) -> Self
pub fn fallback_for_all(self, fallback: Fallback<S>) -> Self
pub fn merge(self, other: Router<S>) -> Self
pub fn layer<L>(self, l: L) -> Selfwhere
L: Layer<DynService> + Clone + Send + Sync + 'static,
L::Service: Service<HttpContext, Incoming, Response = Response, Error = Infallible> + Clone + Send + Sync + 'static,
<L::Service as Service<HttpContext, Incoming>>::Response: Send + 'static,
<L::Service as Service<HttpContext, Incoming>>::Error: Send + 'static,
Trait Implementations§
source§impl Service<HttpContext, Incoming> for Router<()>
impl Service<HttpContext, Incoming> for Router<()>
§type Error = Infallible
type Error = Infallible
Errors produced by the service.
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Cx, Req> ServiceExt<Cx, Req> for Twhere
T: Service<Cx, Req>,
impl<T, Cx, Req> ServiceExt<Cx, Req> for Twhere
T: Service<Cx, Req>,
source§fn map_err<E, F>(self, f: F) -> MapErr<T, F>
fn map_err<E, F>(self, f: F) -> MapErr<T, F>
Maps this service’s error value to a different value. Read more
source§fn map_response<F, Response>(self, f: F) -> MapResponse<T, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<T, F>
Maps this service’s response value to a different value. Read more