Skip to main content

Module router

Module router 

Source

Structs§

PathParams
Named path-segment values extracted from a matched route pattern.
RouteConflict
A route that never runs because one registered before it, with the same method, matches every path it does — what Router::route_conflicts (and AppWithState/AsyncAppWithState’s) report (18.28.0). Patterns are in the :name/*name form.
RouteInfo
A path-based HTTP router with named parameter extraction.
Router

Enums§

RouteConflictKind
How a RouteConflict’s earlier route hides the later one.

Functions§

build_path
url_for on a pattern rather than a name.
name_route
Give the route pattern the name name, for url_for. The app builders call it from their .name(…); call it directly for routes registered some other way.
named_pattern
The pattern registered under name, as it was given (/posts/{id}).
named_routes
Every named route as (name, pattern), sorted by name.
url_for
The path of the route named name with its parameters filled in from params; parameters the pattern doesn’t have become the query string, in the order given. Values are percent-encoded (a wildcard keeps its /s). None when no route has that name or a parameter of the pattern is missing.