pub struct Naming;Expand description
Central naming utility for converting FHIR names to Rust identifiers
Implementations§
Source§impl Naming
impl Naming
Sourcepub fn struct_name(structure_def: &StructureDefinition) -> String
pub fn struct_name(structure_def: &StructureDefinition) -> String
Generate a proper Rust struct name from StructureDefinition
Sourcepub fn field_name(name: &str) -> String
pub fn field_name(name: &str) -> String
Convert a FHIR field name to a valid Rust field name
Sourcepub fn type_suffix(type_code: &str) -> String
pub fn type_suffix(type_code: &str) -> String
Convert FHIR type code to snake_case for field suffix in choice types
Sourcepub fn filename(structure_def: &StructureDefinition) -> String
pub fn filename(structure_def: &StructureDefinition) -> String
Convert a StructureDefinition to a filename using snake_case
Sourcepub fn enum_filename(enum_name: &str) -> String
pub fn enum_filename(enum_name: &str) -> String
Convert an enum name to a filename using snake_case
Sourcepub fn module_name(enum_name: &str) -> String
pub fn module_name(enum_name: &str) -> String
Convert an enum name to a module name using snake_case
Sourcepub fn trait_module_name(name: &str) -> String
pub fn trait_module_name(name: &str) -> String
Convert a trait name to a module name using snake_case
Sourcepub fn to_snake_case(name: &str) -> String
pub fn to_snake_case(name: &str) -> String
Convert a PascalCase type name to snake_case
Sourcepub fn to_pascal_case(s: &str) -> String
pub fn to_pascal_case(s: &str) -> String
Convert a snake_case string to PascalCase
Sourcepub fn capitalize_first(s: &str) -> String
pub fn capitalize_first(s: &str) -> String
Capitalize the first letter of a string
Sourcepub fn to_rust_identifier(name: &str) -> String
pub fn to_rust_identifier(name: &str) -> String
Convert a FHIR name to a valid Rust identifier while preserving the original as much as possible
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
Auto Trait Implementations§
impl Freeze for Naming
impl RefUnwindSafe for Naming
impl Send for Naming
impl Sync for Naming
impl Unpin for Naming
impl UnsafeUnpin for Naming
impl UnwindSafe for Naming
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