Skip to main content

STATIC_ROUTES

Constant STATIC_ROUTES 

Source
pub const STATIC_ROUTES: &[(&str, &str)];
Expand description

Every route the dispatcher answers without an identifier in the path, and the area each one belongs to — "" for a page that belongs to none, which the sidebar does not carry.

Written beside the match that answers them rather than derived from it, because a match over string literals is not data a program can read back at run time. What keeps the two honest is that both are compared, in each direction: every_page_renders_complete_html_with_the_shell_and_the_security_headers drives this list over a socket, so a route the dispatcher lost is a failure; every_plain_arm_of_the_dispatcher_is_a_static_route reads the match from this file’s source, so an arm added there and not here is a failure; and every_area_has_a_route_and_every_route_its_area compares it against the navigation, so a page nothing links to is a failure too. Integration, Reasoning and Economics were the second kind: each arm and area landed after this list was written, and nothing compared the list with the match it describes. /cockpit/quality was exactly that page: the dispatcher answered it, the navigation did not name it, and no test and no browser sweep could reach it, for as long as the two lists were kept by hand and never compared.