Functions§
- decode
- Decode
inputinto aMessagewith flat fields (no dictionary-driven group structure). - decode_
with_ groups - Decode
inputinto aMessagewith repeating groups structured perspec(FR-004, and header/trailer groups per US9, feature 005, FR-026). Header, body, and trailer are each decoded through the same group-aware machinery (decode_section_with_groups) — a section with no declared groups (today, header/trailer always; body whenspechas none for it either) decodes exactly as flat fields, sincespec.group_of(tag)simply never matches. Structure is best-effort/greedy — count/order validation is a separate dictionary concern (seetruefix-dict). - encode
- Encode
msgto SOH-delimited wire bytes. - encode_
with_ order - As
encode, but whenfield_orderisSome, the message body’s top-level fields are emitted in that tag order instead of insertion order (US9, feature 005, FR-027) — fields present infield_ordercome first (in that order), then any body field not listed in it (e.g. a UDF), in its original insertion-relative order, matching QFJ’s ownFieldOrderComparator“unspecified fields last” semantics. Repeating-group entries are unaffected (each entry’s own field order is unconditionally preserved) —field_orderonly reorders the message body’s direct top-level members. - restructure_
groups - Re-group an already-decoded, flat
FieldMapagainstspec— the in-memory counterpart todecode_with_groups’s wire-level grouping (feature 011, FR-008). Needed because a FIXT 1.1 application dictionary is only resolvable after this crate’s decode step already ran (its selection depends on session state — the negotiatedApplVerID— that this crate has no visibility into; seetruefix-session’s post-decode restructuring call site):mapis first flattened back to a plain token stream (recursively, so aMember::Groupentry from some other already-appliedspecis flattened too, not left half-structured) and then re-grouped via [decode_section_with_groups] — the exact same boundary-detection algorithmdecode_with_groupsitself uses, so the two paths can never diverge (Constitution Principle IV). A tagspecdoesn’t recognize as a group ends up a plain field, exactly likedecode_with_groups. Calling this on an already-correctly-structured map (relative tospec) is a safe, idempotent no-op (flattening then immediately re-grouping the same content the same way).