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:
- The Rust type as a
TokenStream. - A boolean indicating whether the type is a primitive/value type, as
determined by
conversion::fhir_type_to_rust_type.
§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:
TokenStreamis the generated Rust type.boolindicates whether the type is a primitive/value type.