pub struct PrimVec<T>(pub Vec<Option<T>>);Expand description
The values of a repeating FHIR primitive element (0..*).
A thin, transparent wrapper over Vec<Option<T>>: None is an
extension-only placeholder — the JSON null whose position in the
paired _element array carries the extension. Use values to iterate
the actual values, iter to see positions.
A placeholder with no corresponding _element entry is meaningless in
FHIR; nothing here prevents constructing one, but the serializer will
faithfully write the null, and validation flags it
(Validate for PrimVec).
Tuple Fields§
§0: Vec<Option<T>>Implementations§
Source§impl<T> PrimVec<T>
impl<T> PrimVec<T>
Sourcepub fn values(&self) -> impl Iterator<Item = &T>
pub fn values(&self) -> impl Iterator<Item = &T>
The values, skipping extension-only placeholders.
Sourcepub fn iter(&self) -> Iter<'_, Option<T>> ⓘ
pub fn iter(&self) -> Iter<'_, Option<T>> ⓘ
Every position: Some(value) or None for a placeholder.
Sourcepub fn push_placeholder(&mut self)
pub fn push_placeholder(&mut self)
Append an extension-only placeholder (a JSON null; its extension
lives at the same index of the _element sibling field).
Sourcepub fn first_value(&self) -> Option<&T>
pub fn first_value(&self) -> Option<&T>
The first actual value, if any position holds one.