Skip to main content

Module emit_api

Module emit_api 

Source
Expand description

API emission for IR operations (Rust APIs).

Groups operations by tag, emits one apis/<tag>.rs per tag group. Each file declares a {Tag}Api struct holding a &runtime::Client and exposes one method per operation.

Backend-specific method bodies are injected via a closure, keeping this module agnostic to the HTTP library (reqwest, ureq, aioduct, etc.).

Re-exports§

pub use crate::generators::multipart::MultipartPart;
pub use crate::generators::multipart::MultipartValueEncoding;

Structs§

BodyBinding
ErrorResponse
OpPlan
ParamBinding
RustBackendConfig
Captures the differences between Rust HTTP backends.
TypedResponse

Enums§

BodyEncoding
ResponseDecoding

Functions§

binary_field_expr
binary_filename_expr
emit_empty_result_init
emit_error_enum
emit_error_response_match
emit_response_match
Emit match status_code { ... } dispatching deserialized bodies into result fields.
emit_response_struct
emit_result_init
Emit let mut result = FooResponse { status_code, field1: None, ... };
error_response_value_expr
generate_api_files
Generate every API file from the IR.
is_copy_type
is_success_status
optional_binary_field_expr
optional_binary_filename_expr
optional_text_field_expr
param_rust_type
pick_body_type
pick_response_type
plan_body
plan_error_response
plan_operation
plan_response
render_to_string
response_field_name
response_headers_init
Clone the native response header map before the response body is consumed.
response_needs_bytes
response_value_expr
response_value_expr_from_str
rust_field_name
rust_string_literal
sanitize_operation_id
status_match_pattern
Convert an OpenAPI status code string to a Rust match pattern.
text_field_expr
unique_name