Skip to main content

field_typename

Function field_typename 

Source
pub fn field_typename<S: BuildHasher>(
    sd: &StructureDefinition,
    element: &ElementDefinition,
    inlined_terminology: &HashMap<String, String, S>,
) -> (TokenStream, bool)
Expand description

Returns the Rust type for a generated struct field.

The returned type depends on the kind of FHIR element:

  • Choice elements ([x]) use the generated choice enum.
  • Nested complex elements use the generated nested struct.
  • All other elements are mapped from their FHIR type to the corresponding Rust type.

The returned tuple contains:

§Panics

This function will panic if a non-choice, non-nested element does not have a declared FHIR type or if the type code is missing.

§Arguments

  • sd - The [StructureDefinition] containing the element.
  • element - The [ElementDefinition] whose field type is being generated.
  • inlined_terminology - A mapping of FHIR terminology bindings to generated Rust types.

§Returns

A tuple (TokenStream, bool) where:

  • TokenStream is the generated Rust type.
  • bool indicates whether the type is a primitive/value type.