Skip to main content

Module route_table

Module route_table 

Source
Expand description

Every route srv’s main router serves, declared once, each with what is decided about it.

A group of routes is one declared_routes! block, in the file of the domain it serves. The block makes the function that builds the group’s router and a table of the same routes, so the router and the table cannot disagree. What is decided about a route is written on its line: today how a call that can change state is recorded (Policy, read by super::http_action). A write with no policy does not compile, so a route cannot be added without deciding it, and tests/http_action_policy.snapshot.txt pins every decision.

Who a route is for follows from its being here: a declared route is for every agent, native or container, unless backend::route_audience names it among its exceptions (a route that needs the host, or is the app’s own). tests/route_audience.snapshot.txt pins who each route is for, so a new route shows there as everyone unless an exception is added with it.

Macros§

declared_routes 🔒
Declares a group of routes: the function that builds their router, and their table.

Structs§

Declared 🔒
One declared route: its method, its path as the router takes it (:param and *rest kept), and how it is recorded when it can change state (None for a read, and for ANY).

Enums§

Policy 🔒
How a call to a route that can change state is recorded (super::http_action). A call the record meets with no decision is recorded.

Constants§

GROUPS 🔒
Every group declared with declared_routes!.

Functions§

declared 🔒
Every route of the main router, group after group.
policy 🔒
How route ("METHOD /template") is recorded; None for a route that is not declared, or is a read. A call the record meets with no decision is recorded.
serves 🔒
Whether the main router serves a route at path, a request’s raw path: what makes a path everyone’s unless backend::route_audience says otherwise.