Module perseus::router [−][src]
Expand description
Utilities regarding routing.
Structs
Information about a route, which, combined with error pages and a client-side translations manager, allows the initialization of the app shell and the rendering of a page.
Enums
The possible outcomes of matching a route. This is an alternative implementation of Sycamore’s Route
trait to enable greater
control and tighter integration of routing with templates. This can only be used if Routes
has been defined in context (done
automatically by the CLI).
Functions
Determines the template to use for the given path by checking against the render configuration., also returning whether we matched
a simple page or an incrementally-generated one (true
for incrementally generated). Note that simple pages include those on
incrementally-generated templates that we pre-rendered with build paths at build-time (and are hence in an immutable store rather
than a mutable store).
Matches the given path to a RouteVerdict
. This takes a TemplateMap
to match against, the render configuration to index, and it
needs to know if i18n is being used. The path this takes should be raw, it may or may not have a locale, but should be split into
segments by /
, with empty ones having been removed.