Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

One route table, two entry points.

Upstream’s /batch re-enters its own router: handleBatch calls router.tryRouteRequest(method, routablePath, request) (batch.js:171) against the same PromiseRouter every HTTP request goes through, so a sub-request and a top-level request are the same code. That includes the route middlewares, because PromiseRouter.route folds them into the handler (PromiseRouter.js:66-84), which is why a /schemas sub-request still needs the master key.

Reproducing that shape here is what keeps a sub-request from drifting from its top-level twin. The axum handlers build a Route from their path extractors; /batch builds one from a string. Both then call dispatch.

Structs§

Incoming
One request, as the dispatcher sees it.
RouteResponse
What a handler produced.

Enums§

Route
A resolved route. Every path parse-rust serves has a variant, and anything else is unroutable.
RouteError
Why a handler failed.

Functions§

dispatch
Run one route.
route_of
Match a path against the 0.2.0 route table.