router

Runtime routing primitives used by declarative Router / Route control flow.

Structs

CompiledRouteBranch

Compiled route branch used by the runtime matcher.

Properties

default

Type: bool

Whether this branch is the fallback default=true branch.

Type: bool

Whether this branch should stack over the previously active branch.


RouteLocation

Structured application location shared across platforms.

On web targets this is serialized to and from window.location, while on non-web targets it remains a platform-agnostic route state model.

Properties

path_segments

Type: Vec<String>

Decoded path segments, with / represented by an empty vector.

query

Type: HashMap<String, Vec<String>>

Query-string values keyed by parameter name, preserving repeated keys.

fragment

Type: Option<String>

Optional fragment without the leading #.

Implementations

root
pub fn root() -> Self

Returns the canonical root location.

with_path_segments
pub fn with_path_segments(&self, path_segments: Vec<String>) -> Self

Clones this location while replacing only the path segments.


RouteMatch

Structured match data exposed to the active route subtree as route.

Properties

location

Type: RouteLocation

Location as seen by the current router scope.

global_location

Type: RouteLocation

Full global application location.

params

Type: HashMap<String, String>

Named values captured from :param segments.

consumed_segments

Type: usize

Number of path segments consumed by the selected branch.

remainder

Type: Vec<String>

Remaining path tail left after the selected branch.

is_exact

Type: bool

Whether the selected branch consumed the entire scoped path.

Implementations

remainder_location
pub fn remainder_location(&self) -> RouteLocation

Converts the remainder into a RouteLocation for nested router input.


RouterInstance

Implementations

instantiate_with_branches
pub fn instantiate_with_branches(args: InstantiationArgs, branches: Vec<CompiledRouteBranch>, branch_child_ranges: Vec<Range<usize>>) -> Rc<Self>

Creates a router instance with precompiled route branches.


RouterProperties

Internal router inputs carried into a RouterInstance.

Properties

input_location

Type: Property<RouteLocation>

Location scoped to the current router.

global_location

Type: Property<RouteLocation>

Full application location retained for diagnostics and coordination.

Constants

INTERNAL_ROUTE_LOCATION_SYMBOL

Internal stack symbol carrying the router input location for nested scopes.


INTERNAL_ROUTE_MATCH_SYMBOL

Internal stack symbol carrying the current route match object.