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 more
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 more
sourcefn with_path_extractor<NPE>(self) -> <Self as ReplacePathExtractor<NPE>>::Output where
NPE: PathExtractor<Body> + Send + Sync + 'static,
fn with_path_extractor<NPE>(self) -> <Self as ReplacePathExtractor<NPE>>::Output where
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 more
sourcefn with_query_string_extractor<NQSE>(
self
) -> <Self as ReplaceQueryStringExtractor<NQSE>>::Output where
NQSE: QueryStringExtractor<Body> + Send + Sync + 'static,
fn with_query_string_extractor<NQSE>(
self
) -> <Self as ReplaceQueryStringExtractor<NQSE>>::Output where
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 more
sourcefn add_route_matcher<NRM>(
self,
matcher: NRM
) -> <Self as ExtendRouteMatcher<NRM>>::Output where
NRM: RouteMatcher + Send + Sync + 'static,
fn add_route_matcher<NRM>(
self,
matcher: NRM
) -> <Self as ExtendRouteMatcher<NRM>>::Output where
NRM: RouteMatcher + Send + Sync + 'static,
Adds additional RouteMatcher
requirements to the current route. Read more
sourcefn to_dir<P>(self, options: P) where
Self: Sized,
Self: ReplacePathExtractor<FilePathExtractor>,
Self::Output: DefineSingleRoute,
FileOptions: From<P>,
fn to_dir<P>(self, options: P) where
Self: Sized,
Self: ReplacePathExtractor<FilePathExtractor>,
Self::Output: DefineSingleRoute,
FileOptions: From<P>,
Directs the route to serve static files from the given root directory. The route must contain a trailing glob segment, which will be used to serve any matching names under the given path. Read more
sourceimpl<'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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more