pub struct MessageChunk {
pub envelope: Arc<Vec<OwnedSegment>>,
pub unh: OwnedSegment,
pub body: Vec<OwnedSegment>,
pub unt: OwnedSegment,
}Expand description
A single EDIFACT message (UNH…UNT) with its interchange envelope.
Fields§
§envelope: Arc<Vec<OwnedSegment>>Interchange envelope segments (UNA, UNB) — shared across all messages via Arc.
unh: OwnedSegmentThe UNH segment itself.
body: Vec<OwnedSegment>Segments between UNH and UNT (exclusive of both).
unt: OwnedSegmentThe UNT segment itself.
Implementations§
Source§impl MessageChunk
impl MessageChunk
Sourcepub fn all_segments(&self) -> Vec<OwnedSegment>
pub fn all_segments(&self) -> Vec<OwnedSegment>
Reconstruct the full segment list for this message (envelope + UNH + body + UNT).
Note: only use this when the MIG schema includes envelope segments (UNA, UNB).
For MIG schemas that start at UNH, use message_segments() instead.
Sourcepub fn message_segments(&self) -> Vec<OwnedSegment>
pub fn message_segments(&self) -> Vec<OwnedSegment>
Message-only segments (UNH + body + UNT), excluding interchange envelope.
Use this for assembly when the MIG schema starts at UNH (most message types).
UTILMD MIG schemas include UNA/UNB, so those still need all_segments().
Sourcepub fn segments_for_mig(&self, mig: &MigSchema) -> Vec<OwnedSegment>
pub fn segments_for_mig(&self, mig: &MigSchema) -> Vec<OwnedSegment>
Return the appropriate segments for assembly based on whether the MIG includes envelope segments (UNA/UNB) or starts at UNH.
Trait Implementations§
Source§impl Clone for MessageChunk
impl Clone for MessageChunk
Source§fn clone(&self) -> MessageChunk
fn clone(&self) -> MessageChunk
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more