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§

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
Similar to to, but accepts an async fn Read more
Directs the route to the given async fn, passing State to it by mutable reference. Read more
Directs the route to the given NewHandler. This gives more control over how Handler values are constructed. Read more
Applies a PathExtractor type to the current route, to extract path parameters into State with the given type. Read more
Applies a QueryStringExtractor type to the current route, to extract query parameters into State with the given type. Read more
Adds additional RouteMatcher requirements to the current route. Read more
Directs the route to serve a single static file from the given path. Read more

The type returned when extending the existing RouteMatcher with the target type.

The type returned when replacing the PathExtractor with the target type.
The type returned when replacing the QueryStringExtractor with the target type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more