pub struct Component {
pub sub_components: Vec<SubComponent>,
pub is_subcomponentized: bool,
/* private fields */
}Expand description
A component of an HL7 field, containing one or more SubComponents
separated by the subcomponent delimiter.
Fields§
§sub_components: Vec<SubComponent>The parsed subcomponents (always at least one).
is_subcomponentized: booltrue when the component contains more than one subcomponent.
Implementations§
Source§impl Component
impl Component
Sourcepub fn parse(raw: &str, enc: &HL7Encoding) -> Self
pub fn parse(raw: &str, enc: &HL7Encoding) -> Self
Parses a component from its raw value, splitting on the subcomponent delimiter.
Sourcepub fn raw(&self, enc: &HL7Encoding) -> Option<&str>
pub fn raw(&self, enc: &HL7Encoding) -> Option<&str>
The raw value, or None when “present but null”.
Sourcepub fn value(&self, enc: &HL7Encoding) -> Option<String>
pub fn value(&self, enc: &HL7Encoding) -> Option<String>
The decoded value, or None when “present but null”.
Sourcepub fn set_value(&mut self, value: &str, enc: &HL7Encoding)
pub fn set_value(&mut self, value: &str, enc: &HL7Encoding)
Re-parses the component from a new raw value.
Sourcepub fn sub_component(&self, position: usize) -> Result<&SubComponent, Hl7Error>
pub fn sub_component(&self, position: usize) -> Result<&SubComponent, Hl7Error>
Returns the subcomponent at the given 1-based position.
Trait Implementations§
impl Eq for Component
impl StructuralPartialEq for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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