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
Auto Trait Implementations§
impl Freeze for GeneratorUtils
impl RefUnwindSafe for GeneratorUtils
impl Send for GeneratorUtils
impl Sync for GeneratorUtils
impl Unpin for GeneratorUtils
impl UnsafeUnpin for GeneratorUtils
impl UnwindSafe for GeneratorUtils
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more