pub struct SegmentStructure { /* private fields */ }Expand description
Maps segment tags to their expected element count from the MIG schema.
Element count = data_elements.len() + composites.len() for each segment.
This matches the EDIFACT convention where each data element or composite
occupies one element position separated by +.
Implementations§
Source§impl SegmentStructure
impl SegmentStructure
Sourcepub fn from_mig(mig: &MigSchema) -> Self
pub fn from_mig(mig: &MigSchema) -> Self
Build from a MIG schema by walking all segments (top-level and within groups).
First occurrence of a segment tag wins — the same tag always has the same element structure in EDIFACT.
Sourcepub fn element_count(&self, tag: &str) -> Option<usize>
pub fn element_count(&self, tag: &str) -> Option<usize>
Look up the expected element count for a segment tag.
Trait Implementations§
Source§impl Clone for SegmentStructure
impl Clone for SegmentStructure
Source§fn clone(&self) -> SegmentStructure
fn clone(&self) -> SegmentStructure
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<'de> Deserialize<'de> for SegmentStructure
impl<'de> Deserialize<'de> for SegmentStructure
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
Auto Trait Implementations§
impl Freeze for SegmentStructure
impl RefUnwindSafe for SegmentStructure
impl Send for SegmentStructure
impl Sync for SegmentStructure
impl Unpin for SegmentStructure
impl UnsafeUnpin for SegmentStructure
impl UnwindSafe for SegmentStructure
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