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
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>
Converts
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>
Converts
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