This crate is for parsing and acting on EDI X12 documents. It exposes two main entry points for parsing:
parse(). The strictest parsing mode is
parse(), which parses a string and constructs
an EdiDocument in a zero-copy (almost -- more on that later) way.
loose_parse() does the same thing, but
does not check and validate that segment closers (IEA, GE, SE) match their openers' ID or have the correct amount
Under the hood, this crate uses
std::borrow::Cow<&str> for processing EDI documents. This means that if you are
not writing or mutating the document, it is zero copy. As soon as you write to or mutate any part of the
that one part is copied. See the documentation for
std::borrow::Cow for more details.
This crate also supports zero-copy serialization and deserialization via
serde. That means that this crate,
with the help of
serde, also supports serialization to:
- and more...
There are examples in the examples directory.
Represents an entire parsed EDI document with both the envelope (i.e. metadata) and the data segments.
Represents an error that occurred at any point in parsing a document. Contains a reason the error occurred and the segment in which the error occurred.
Represents a GS/GE segment which wraps a functional group. Documentation here gleaned mostly from here
A generic segment.
Represents the ISA/IEA header information commonly known as the "envelope" in X12 EDI.
Represents a transaction in an EDI document. A transaction is initialized with an ST segment and ended with an SE segment.
This is an alternate parser which does not perform closing tag validation. If you are receiving EDI documents which have had less rigor applied to their construction, this may help. The number of documents in the confirmation and the IDs on the closing tags don't need to match.