Skip to main content

Module ir

Module ir 

Source
Expand description

Intermediate representation (IR) of generated Rust types.

The schema mapping pass (crate::lower::schema) lowers OpenAPI schemas into this IR. The emit pass (crate::emit) turns the IR into a token stream. Keeping the two separate makes the mapping logic testable without touching token generation, and keeps emission free of OpenAPI concerns.

Structs§

Alias
A generated type X = Y; alias.
Body
A request or response body: its Rust type plus the wire content type that selects the axum extractor / response wrapper.
BodyVariant
One content-type representation within a NegotiatedBody.
Constraints
The validation keywords a schema declares.
CookieParam
A single cookie parameter within a Cookies struct.
Cookies
A generated per-operation cookie struct, extracted via a hand-written axum::extract::FromRequestParts implementation backed by axum_extra’s CookieJar.
Deprecation
A #[deprecated] annotation derived from deprecated: true, optionally carrying the x-deprecated-reason text as the note.
Enum
A generated enum.
Field
A single struct field.
ForeignDerives
Which of the three non-serde traits every generated model derives a foreign type satisfies.
HeaderParam
A single header parameter within a Headers struct.
Headers
A generated per-operation header struct, extracted via a hand-written axum::extract::FromRequestParts implementation rather than serde, since header values are read and parsed individually from the request parts.
IntegerVariant
A unit variant of an integer enum.
Module
A generated Rust source module: an ordered list of top-level items.
Multipart
A multipart/form-data request body lowered into a per-operation extractor.
MultipartField
A single field of a Multipart body.
NegotiatedBody
A body offering several content-type representations, lowered into a generated enum with one variant per representation.
Operation
A single HTTP operation lowered for code generation.
Param
A typed operation parameter (path parameter in the current slice).
ResponseCase
One arm of an operation’s response enum.
ResponseHeader
A single declared response header written by the generated IntoResponse.
SecurityScheme
A security scheme the client can apply to outgoing requests.
ServerUrlBuilder
A server URL with {placeholder}s emitted as a builder function that substitutes each variable and returns the resulting URL.
ServerUrlConst
A variable-free server URL emitted as a string constant.
ServerUrlEnum
An enum type generated for an enum-constrained server variable.
ServerUrlEnumVariant
One variant of a ServerUrlEnum: a Rust identifier and its wire value.
ServerUrlParam
One parameter of a ServerUrlBuilder, bound to a URL placeholder.
ServerUrls
The lowered servers: block: constants and builder functions for each declared server URL, plus the enum types their variables reference.
Service
A generated axum server interface: the Api trait plus the operations that back its Router.
StringVariant
A unit variant of a string enum.
Struct
A generated struct.
UnionVariant
A newtype variant of a union enum.

Enums§

BodyKind
The supported request/response content type for a Body.
Bound
A numeric bound, in the form the document writes it.
DefaultValue
The value that serde uses when a property is absent.
EnumKind
The flavour of a generated enum.
Item
A top-level item declaration.
RequestPayload
An operation’s request payload, when it declares one.
ResponseBody
The body of a response variant, when it declares supported content.
ResponseStatus
How a response variant’s HTTP status code is produced.
RustType
A Rust type expression usable in field/alias position.
SecuritySchemeKind
How a SecurityScheme’s credential is applied to a request.
ServerUrl
A single lowered server URL: either a constant or a builder function.
ServerUrlParamType
The type of a ServerUrlParam.