Skip to main content

Module api

Module api 

Source
Expand description

The HTTP surface, built by folding over the declared operations.

§The router is the declaration

Nothing here writes a route out. router walks OPERATIONS and registers one route per entry beneath the one versioned prefix, so the set served and the set declared cannot come apart — and the ten mutating operations share one handler which is given the ActionKind its own entry declares, so a request cannot reach an action the operation it was sent to does not name.

§Every action takes the same one path

An action asked for here goes to Supervisor::request_action, which is the same call an operator’s action makes and an agent’s action makes. The policy is not re-implemented here and is not bypassed here: a rejected request answers the rejection the policy made, carrying its reason, the value asked for and the range allowed, and reaches no action method of the printer port at all.

Structs§

ApiState
What every handler is given: the supervisor, and the store beside it.
HistoryParams
How many events a history read asks for, when it asks for a number.

Functions§

router
Every public operation, beneath the one versioned prefix.