pub struct OwnedSegment {
pub id: String,
pub elements: Vec<Vec<String>>,
pub segment_number: u32,
}Expand description
An owned version of a parsed EDIFACT segment — stores String data.
Used for the two-pass assembler: pass 1 collects segments into this type, pass 2 consumes them guided by the MIG schema.
Fields§
§id: StringSegment identifier (e.g., “NAD”, “LOC”, “DTM”).
elements: Vec<Vec<String>>Elements, where each element is a vector of component strings.
elements[i][j] = component j of element i.
segment_number: u321-based segment number within the message.
Implementations§
Source§impl OwnedSegment
impl OwnedSegment
Sourcepub fn get_element(&self, index: usize) -> &str
pub fn get_element(&self, index: usize) -> &str
Gets the first component of element at index, or empty string if missing.
Sourcepub fn get_component(
&self,
element_index: usize,
component_index: usize,
) -> &str
pub fn get_component( &self, element_index: usize, component_index: usize, ) -> &str
Gets a specific component within an element, or empty string if missing.
Trait Implementations§
Source§impl Clone for OwnedSegment
impl Clone for OwnedSegment
Source§fn clone(&self) -> OwnedSegment
fn clone(&self) -> OwnedSegment
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 OwnedSegment
impl Debug for OwnedSegment
Source§impl<'de> Deserialize<'de> for OwnedSegment
impl<'de> Deserialize<'de> for OwnedSegment
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 OwnedSegment
impl PartialEq for OwnedSegment
Source§impl Serialize for OwnedSegment
impl Serialize for OwnedSegment
impl StructuralPartialEq for OwnedSegment
Auto Trait Implementations§
impl Freeze for OwnedSegment
impl RefUnwindSafe for OwnedSegment
impl Send for OwnedSegment
impl Sync for OwnedSegment
impl Unpin for OwnedSegment
impl UnsafeUnpin for OwnedSegment
impl UnwindSafe for OwnedSegment
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