pub struct GeneratorUtils;Expand description
Utility functions for code generation
Implementations§
Source§impl GeneratorUtils
impl GeneratorUtils
Sourcepub fn to_pascal_case(s: &str) -> String
pub fn to_pascal_case(s: &str) -> String
Convert a string to PascalCase
Sourcepub fn to_snake_case(name: &str) -> String
pub fn to_snake_case(name: &str) -> String
Convert a PascalCase type name to snake_case for module imports
Sourcepub fn capitalize_first_letter(s: &str) -> String
pub fn capitalize_first_letter(s: &str) -> String
Capitalize the first letter of a string
Sourcepub fn generate_struct_name(structure_def: &StructureDefinition) -> String
pub fn generate_struct_name(structure_def: &StructureDefinition) -> String
Generate a proper Rust struct name from StructureDefinition URL or ID
Sourcepub fn to_valid_rust_identifier(name: &str) -> String
pub fn to_valid_rust_identifier(name: &str) -> String
Convert a FHIR name to a valid Rust identifier while preserving the original as much as possible
Sourcepub fn fix_acronyms(name: &str) -> String
pub fn fix_acronyms(name: &str) -> String
Fix common FHIR acronyms to maintain proper casing
Sourcepub fn is_valid_rust_identifier(name: &str) -> bool
pub fn is_valid_rust_identifier(name: &str) -> bool
Check if a string is a valid Rust identifier
Sourcepub fn is_rust_keyword(name: &str) -> bool
pub fn is_rust_keyword(name: &str) -> bool
Check if a string is a Rust keyword
Sourcepub fn to_rust_field_name(name: &str) -> String
pub fn to_rust_field_name(name: &str) -> String
Convert a FHIR field name to a valid Rust field name
Sourcepub fn to_filename(structure_def: &StructureDefinition) -> String
pub fn to_filename(structure_def: &StructureDefinition) -> String
Convert a FHIR resource type name to filename using snake_case
Sourcepub fn is_primitive_type(type_name: &str) -> bool
pub fn is_primitive_type(type_name: &str) -> bool
Check if a type name represents a primitive Rust type
Sourcepub fn is_fhir_resource_type(type_name: &str) -> bool
pub fn is_fhir_resource_type(type_name: &str) -> bool
Check if a type is a FHIR resource type
Sourcepub fn is_fhir_datatype(name: &str) -> bool
pub fn is_fhir_datatype(name: &str) -> bool
Check if a type name represents a known FHIR data type
Sourcepub fn is_fhir_primitive_type(type_name: &str) -> bool
pub fn is_fhir_primitive_type(type_name: &str) -> bool
Check if a type is a FHIR primitive type
Sourcepub fn is_generated_trait(type_name: &str) -> bool
pub fn is_generated_trait(type_name: &str) -> bool
Check if a type is a generated trait
Sourcepub fn get_import_path_for_type(type_name: &str) -> String
pub fn get_import_path_for_type(type_name: &str) -> String
Determine the correct import path for a given type name