pub struct BindingGenerator;Expand description
Generator for binding constants
Implementations§
Source§impl BindingGenerator
impl BindingGenerator
Sourcepub fn generate_bindings_constant(structure_def: &StructureDefinition) -> String
pub fn generate_bindings_constant(structure_def: &StructureDefinition) -> String
Generate a BINDINGS constant for a StructureDefinition
Returns Rust code as a string containing the static declaration, or an empty string if there are no required bindings.
Uses once_cell::sync::Lazy for runtime initialization.
Example output:
ⓘ
pub static BINDINGS: once_cell::sync::Lazy<Vec<rh_foundation::ElementBinding>> =
once_cell::sync::Lazy::new(|| vec![
rh_foundation::ElementBinding::new(
"Patient.gender",
rh_foundation::BindingStrength::Required,
"http://hl7.org/fhir/ValueSet/administrative-gender"
).with_description("The gender of the patient"),
]);Sourcepub fn generate_bindings_tokens(
structure_def: &StructureDefinition,
) -> TokenStream
pub fn generate_bindings_tokens( structure_def: &StructureDefinition, ) -> TokenStream
Generate bindings constant using quote! macro (alternative implementation)
Auto Trait Implementations§
impl Freeze for BindingGenerator
impl RefUnwindSafe for BindingGenerator
impl Send for BindingGenerator
impl Sync for BindingGenerator
impl Unpin for BindingGenerator
impl UnsafeUnpin for BindingGenerator
impl UnwindSafe for BindingGenerator
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
Mutably borrows from an owned value. Read more