Skip to main content

validate_envelope

Function validate_envelope 

Source
pub fn validate_envelope(
    segments: &[Segment<'_>],
) -> Result<ValidatedInterchange, EdifactError>
Expand description

Validate the EDIFACT interchange envelope, failing at the first violation.

Supports direct-message interchanges and functional-group interchanges, and checks every service-segment value against ISO 9735-10:2002 §5. Returns ValidatedInterchange on success.

Accepts segments from either parsing path — &[OwnedSegment] coerces to &[Segment<'_>].

§Errors

The first violation found, in discovery order. Use validate_envelope_lenient to collect all of them.