Expand description
Defines a builder API for constructing a Router.
Structs§
- Associated
Route Builder - Implements the methods required for associating a number of routes with a single path. This is
used by
DrawRoutes::associated. - Delegate
Route Builder - A delegated builder, which is created by
DrawRoutes::delegateand returned. TheDrawRoutestrait has documentation for using this type. - Router
Builder - The top-level builder which is created by
build_routerand passed to the provided closure. See thebuild_routerfunction and theDrawRoutestrait for usage. - Scope
Builder - A scoped builder, which is created by
DrawRoutes::scopeand passed to the provided closure. TheDrawRoutestrait has documentation for using this type. - Single
Route Builder - Implements the traits required to define a single route, after determining which request paths
will be dispatched here. The
DefineSingleRoutetrait has documentation for using this type.
Traits§
- Define
Single Route - Describes the API for defining a single route, after determining which request paths will be
dispatched here. The API here uses chained function calls to build and add the route into the
RouterBuilderwhich created it. - Draw
Routes - Defines functions used by a builder to determine which request paths will be dispatched to a
route. This trait is implemented by the top-level
RouterBuilder, and also theScopedBuildercreated byDrawRoutes::scope. - Extend
Route Matcher - Describes the operation of extending a
RouteMatcheron a route. This trait exists to remove type clutter from the documentation ofSingleRouteBuilder::add_route_matcher. - Replace
Path Extractor - Describes the operation of replacing a
PathExtractoron a route. This trait exists to remove type clutter from the documentation ofSingleRouteBuilder::with_path_extractor. - Replace
Query String Extractor - Describes the operation of replacing a
QueryStringExtractoron a route. This trait exists to remove type clutter from the documentation ofSingleRouteBuilder::with_query_string_extractor.
Functions§
- build_
router - Builds a
Routerusing the provided closure. Routes are defined using theRouterBuildervalue passed to the closure, and theRouteris constructed before returning. - build_
simple_ router - Builds a
Routerwith no middleware using the provided closure. Routes are defined using theRouterBuildervalue passed to the closure, and theRouteris constructed before returning.
Type Aliases§
- Associated
Single Route Builder - The default type returned when building a single associated route. See
router::builder::DefineSingleRoutefor an overview of the ways that a route can be specified.