Skip to main content

decode_with_groups

Function decode_with_groups 

Source
pub fn decode_with_groups(
    input: &[u8],
    spec: &dyn GroupSpec,
) -> Result<Message, DecodeError>
Expand description

Decode input into a Message with repeating groups structured per spec (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 when spec has none for it either) decodes exactly as flat fields, since spec.group_of(tag) simply never matches. Structure is best-effort/greedy — count/order validation is a separate dictionary concern (see truefix-dict).