pub struct ElementCardinality {
pub path: String,
pub min: usize,
pub max: Option<usize>,
}Expand description
Element cardinality constraint
Defines the minimum and maximum occurrences allowed for a FHIR element. This structure is shared between the validator and code generator.
Fields§
§path: StringElement path (e.g., “Patient.identifier”, “Patient.name”)
min: usizeMinimum occurrences (0 = optional, 1+ = required)
max: Option<usize>Maximum occurrences (None = unbounded (*), Some(n) = up to n)
Implementations§
Source§impl ElementCardinality
impl ElementCardinality
Sourcepub fn new(path: impl Into<String>, min: usize, max: Option<usize>) -> Self
pub fn new(path: impl Into<String>, min: usize, max: Option<usize>) -> Self
Create a new cardinality constraint
Sourcepub fn is_unbounded(&self) -> bool
pub fn is_unbounded(&self) -> bool
Check if the cardinality allows unbounded occurrences
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Check if the element is required (min > 0)
Sourcepub fn to_fhir_notation(&self) -> String
pub fn to_fhir_notation(&self) -> String
Format cardinality as FHIR notation (e.g., “0..1”, “1..*”, “0..5”)
Trait Implementations§
Source§impl Clone for ElementCardinality
impl Clone for ElementCardinality
Source§fn clone(&self) -> ElementCardinality
fn clone(&self) -> ElementCardinality
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElementCardinality
impl Debug for ElementCardinality
Source§impl<'de> Deserialize<'de> for ElementCardinality
impl<'de> Deserialize<'de> for ElementCardinality
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ElementCardinality
impl PartialEq for ElementCardinality
Source§impl Serialize for ElementCardinality
impl Serialize for ElementCardinality
impl Eq for ElementCardinality
impl StructuralPartialEq for ElementCardinality
Auto Trait Implementations§
impl Freeze for ElementCardinality
impl RefUnwindSafe for ElementCardinality
impl Send for ElementCardinality
impl Sync for ElementCardinality
impl Unpin for ElementCardinality
impl UnsafeUnpin for ElementCardinality
impl UnwindSafe for ElementCardinality
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