Skip to main content

Module naming

Module naming 

Source
Expand description

Conversion of OpenAPI names into valid, idiomatic Rust identifiers and derivation of per-operation artifact names.

Modules§

operations
Derivation of the Rust names of the artifacts generated for an operation. Deriving the Rust names of the artifacts generated for one OpenAPI operation.

Structs§

RustIdent
A Rust identifier together with whether it must be emitted as a raw identifier (r#name).

Enums§

Case
Casing to apply when converting a name.

Functions§

deconflict_ident
Make ident unique among the identifiers in seen. A collision gets the lowest free numeric suffix: Foo, Foo2, Foo3, and so on. The function adds the chosen identifier to seen. The key is the logical identifier text, so foo and Foo count as different identifiers.
rename_for
Compute the serde rename value for a member, given its wire name and the chosen Rust identifier. Returns None when no rename attribute is needed.
to_ident
Convert an arbitrary OpenAPI name into a valid Rust identifier in the requested case, escaping keywords and leading digits.