Skip to main content

Module op_list

Module op_list 

Expand description

The one list of ops a schema exposes (cratestack#1123, EXT-14).

Which verbs a model has, and how an op is keyed, used to be derived separately by the RPC descriptors, the REST descriptors, the axum router, RPC dispatch and every client generator, each by asking model_internal_actions and adding its own list of verb names. A contract digest is keyed by op, so those copies must not be able to disagree. They all ask model_verbs now, and crate::client_contract’s op list is built from it.

A generator may still expose fewer verbs than this list (the TypeScript client omits create for a model with no create policy): that is a client-side choice on top of this list, never a verb beyond it.

Structs§

ModelOpIds
The five RPC op ids of a model, for a generator’s template context, so a template never spells "model.<Name>.list" itself. A verb @@internal suppresses still has an id here: the template only reads the ones its own allows_* gate admits.

Enums§

ModelVerb
What an op does to its model.

Functions§

detail_route_of
The detail route of the collection route list_route, for a caller that holds the route and not the model name.
model_detail_route
The detail route of a model on REST: /widgets/{id}.
model_list_route
The collection route of a model on REST: /widgets.
model_op_key
The op key of a model verb: the RPC op id, or "<METHOD> <route>" on REST. None for a verb REST does not have.
model_subscribe_route
The subscription route of a model on REST: /widgets/$subscribe.
model_verbs
The verbs model exposes, in ModelVerb::CRUD order with Subscribe last: every CRUD verb @@internal does not suppress, plus Subscribe for an @@subscribe model.
procedure_op_key
The op key of a procedure: procedure.<name> on RPC, POST <path> on REST (the path carries @api_version).
subscription_procedure_op_key
The op key of a subscription procedure (slice S4): procedure.<name> on RPC, as a unary procedure; GET <path> on REST, its stream served over SSE at the path a unary procedure would POST to.