pub struct AssembledTree {
pub segments: Vec<AssembledSegment>,
pub groups: Vec<AssembledGroup>,
pub post_group_start: usize,
pub inter_group_segments: BTreeMap<usize, Vec<AssembledSegment>>,
}Expand description
A generic assembled tree node (before PID-specific typing).
Fields§
§segments: Vec<AssembledSegment>§groups: Vec<AssembledGroup>§post_group_start: usizeIndex in segments where post-group segments start (e.g., UNT, UNZ).
Segments before this index appear before groups in EDIFACT order.
inter_group_segments: BTreeMap<usize, Vec<AssembledSegment>>Root segments consumed between groups during assembly (e.g., UNS
section separator in MSCONS). Key = index into groups vec; value =
segments that appear immediately before that group in the EDIFACT
stream. Empty for messages without inter-group root segments.
Implementations§
Source§impl AssembledTree
impl AssembledTree
Sourcepub fn transaction_view(
&self,
group_id: &str,
index: usize,
) -> Option<TransactionView>
pub fn transaction_view( &self, group_id: &str, index: usize, ) -> Option<TransactionView>
The message as transaction index of the top-level group group_id
sees it (see the module). None when the
group has no such repetition.
Source§impl AssembledTree
impl AssembledTree
Sourcepub fn transaction_views<'t>(
&'t self,
segments: &'t [OwnedSegment],
is_transaction_group: impl Fn(&str) -> bool,
) -> TransactionViews<'t>
pub fn transaction_views<'t>( &'t self, segments: &'t [OwnedSegment], is_transaction_group: impl Fn(&str) -> bool, ) -> TransactionViews<'t>
Prepares the views transaction_view gives,
of every top-level group is_transaction_group accepts, over the
message segments the tree was assembled from (matched by
segment_number).