pub struct SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,{ /* private fields */ }
Expand description
Implements the traits required to define a single route, after determining which request paths
will be dispatched here. The DefineSingleRoute
trait has documentation for using this type.
Trait Implementations
sourceimpl<'a, M, C, P, PE, QSE> DefineSingleRoute for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
impl<'a, M, C, P, PE, QSE> DefineSingleRoute for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
sourcefn to<H>(self, handler: H)where
H: Handler + RefUnwindSafe + Copy + Send + Sync + 'static,
fn to<H>(self, handler: H)where
H: Handler + RefUnwindSafe + Copy + Send + Sync + 'static,
Directs the route to the given
Handler
, automatically creating a NewHandler
which
copies the Handler
. This is the easiest option for code which is using bare functions as
Handler
functions. Read moresourcefn to_async<H, Fut>(self, handler: H)where
Self: Sized,
H: FnOnce(State) -> Fut + RefUnwindSafe + Copy + Send + Sync + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
fn to_async<H, Fut>(self, handler: H)where
Self: Sized,
H: FnOnce(State) -> Fut + RefUnwindSafe + Copy + Send + Sync + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
sourcefn to_async_borrowing<F>(self, handler: F)where
Self: Sized,
F: HandlerMarker + Copy + Send + Sync + RefUnwindSafe + 'static,
fn to_async_borrowing<F>(self, handler: F)where
Self: Sized,
F: HandlerMarker + Copy + Send + Sync + RefUnwindSafe + 'static,
sourcefn to_new_handler<NH>(self, new_handler: NH)where
NH: NewHandler + 'static,
fn to_new_handler<NH>(self, new_handler: NH)where
NH: NewHandler + 'static,
Directs the route to the given
NewHandler
. This gives more control over how Handler
values are constructed. Read moresourcefn with_path_extractor<NPE>(self) -> <Self as ReplacePathExtractor<NPE>>::Outputwhere
NPE: PathExtractor<Body> + Send + Sync + 'static,
fn with_path_extractor<NPE>(self) -> <Self as ReplacePathExtractor<NPE>>::Outputwhere
NPE: PathExtractor<Body> + Send + Sync + 'static,
Applies a
PathExtractor
type to the current route, to extract path parameters into
State
with the given type. Read moresourcefn with_query_string_extractor<NQSE>(
self
) -> <Self as ReplaceQueryStringExtractor<NQSE>>::Outputwhere
NQSE: QueryStringExtractor<Body> + Send + Sync + 'static,
fn with_query_string_extractor<NQSE>(
self
) -> <Self as ReplaceQueryStringExtractor<NQSE>>::Outputwhere
NQSE: QueryStringExtractor<Body> + Send + Sync + 'static,
Applies a
QueryStringExtractor
type to the current route, to extract query parameters into
State
with the given type. Read moresourcefn add_route_matcher<NRM>(
self,
matcher: NRM
) -> <Self as ExtendRouteMatcher<NRM>>::Outputwhere
NRM: RouteMatcher + Send + Sync + 'static,
fn add_route_matcher<NRM>(
self,
matcher: NRM
) -> <Self as ExtendRouteMatcher<NRM>>::Outputwhere
NRM: RouteMatcher + Send + Sync + 'static,
Adds additional
RouteMatcher
requirements to the current route. Read moresourceimpl<'a, M, NRM, C, P, PE, QSE> ExtendRouteMatcher<NRM> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
NRM: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
impl<'a, M, NRM, C, P, PE, QSE> ExtendRouteMatcher<NRM> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
NRM: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
type Output = SingleRouteBuilder<'a, AndRouteMatcher<M, NRM>, C, P, PE, QSE>
type Output = SingleRouteBuilder<'a, AndRouteMatcher<M, NRM>, C, P, PE, QSE>
The type returned when extending the existing RouteMatcher
with the target type.
sourceimpl<'a, M, C, P, PE, QSE, NPE> ReplacePathExtractor<NPE> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
NPE: PathExtractor<Body> + Send + Sync + 'static,
impl<'a, M, C, P, PE, QSE, NPE> ReplacePathExtractor<NPE> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
NPE: PathExtractor<Body> + Send + Sync + 'static,
type Output = SingleRouteBuilder<'a, M, C, P, NPE, QSE>
type Output = SingleRouteBuilder<'a, M, C, P, NPE, QSE>
The type returned when replacing the
PathExtractor
with the target type.sourceimpl<'a, M, C, P, PE, QSE, NQSE> ReplaceQueryStringExtractor<NQSE> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
NQSE: QueryStringExtractor<Body> + Send + Sync + 'static,
impl<'a, M, C, P, PE, QSE, NQSE> ReplaceQueryStringExtractor<NQSE> for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
M: RouteMatcher + Send + Sync + 'static,
C: PipelineHandleChain<P> + Send + Sync + 'static,
P: RefUnwindSafe + Send + Sync + 'static,
PE: PathExtractor<Body> + Send + Sync + 'static,
QSE: QueryStringExtractor<Body> + Send + Sync + 'static,
NQSE: QueryStringExtractor<Body> + Send + Sync + 'static,
type Output = SingleRouteBuilder<'a, M, C, P, PE, NQSE>
type Output = SingleRouteBuilder<'a, M, C, P, PE, NQSE>
The type returned when replacing the
QueryStringExtractor
with the target type.Auto Trait Implementations
impl<'a, M, C, P, PE, QSE> RefUnwindSafe for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
P: RefUnwindSafe,
impl<'a, M, C, P, PE, QSE> Send for SingleRouteBuilder<'a, M, C, P, PE, QSE>
impl<'a, M, C, P, PE, QSE> Sync for SingleRouteBuilder<'a, M, C, P, PE, QSE>
impl<'a, M, C, P, PE, QSE> Unpin for SingleRouteBuilder<'a, M, C, P, PE, QSE>where
C: Unpin,
M: Unpin,
PE: Unpin,
QSE: Unpin,
impl<'a, M, C, P, PE, QSE> !UnwindSafe for SingleRouteBuilder<'a, M, C, P, PE, QSE>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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