pub struct CodeGenerator { /* private fields */ }Implementations§
Source§impl CodeGenerator
impl CodeGenerator
Sourcepub fn generate_http_client_struct(&self) -> TokenStream
pub fn generate_http_client_struct(&self) -> TokenStream
Generate the HTTP client struct with middleware support
Sourcepub fn generate_operation_methods(
&self,
analysis: &SchemaAnalysis,
) -> TokenStream
pub fn generate_operation_methods( &self, analysis: &SchemaAnalysis, ) -> TokenStream
Generate HTTP operation methods for the client.
Emits per-operation typed error enums (one variant per declared non-2xx
response with a body schema) BEFORE the impl HttpClient block so the
generated method signatures can reference them.
Source§impl CodeGenerator
impl CodeGenerator
pub fn new(config: GeneratorConfig) -> Self
Sourcepub fn config(&self) -> &GeneratorConfig
pub fn config(&self) -> &GeneratorConfig
Get reference to the generator configuration
Sourcepub fn generate_all(
&self,
analysis: &mut SchemaAnalysis,
) -> Result<GenerationResult>
pub fn generate_all( &self, analysis: &mut SchemaAnalysis, ) -> Result<GenerationResult>
Generate all files for the API
Sourcepub fn generate(&self, analysis: &mut SchemaAnalysis) -> Result<String>
pub fn generate(&self, analysis: &mut SchemaAnalysis) -> Result<String>
Generate just the types (legacy single-file interface)
Sourcepub fn generate_http_client(&self, analysis: &SchemaAnalysis) -> Result<String>
pub fn generate_http_client(&self, analysis: &SchemaAnalysis) -> Result<String>
Generate HTTP client code for regular (non-streaming) requests
Sourcepub fn write_files(&self, result: &GenerationResult) -> Result<()>
pub fn write_files(&self, result: &GenerationResult) -> Result<()>
Helper method to write all generated files to disk
Sourcepub fn is_rust_keyword(s: &str) -> bool
pub fn is_rust_keyword(s: &str) -> bool
Check if a string is a Rust keyword that needs raw identifier treatment
Sourcepub fn to_field_ident(name: &str) -> Ident
pub fn to_field_ident(name: &str) -> Ident
Create a proc_macro2::Ident from a field name, handling r# raw identifiers
Source§impl CodeGenerator
impl CodeGenerator
Sourcepub fn generate_registry(&self, analysis: &SchemaAnalysis) -> Result<String>
pub fn generate_registry(&self, analysis: &SchemaAnalysis) -> Result<String>
Generate the registry.rs file content
Auto Trait Implementations§
impl Freeze for CodeGenerator
impl RefUnwindSafe for CodeGenerator
impl Send for CodeGenerator
impl Sync for CodeGenerator
impl Unpin for CodeGenerator
impl UnsafeUnpin for CodeGenerator
impl UnwindSafe for CodeGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more