7 releases

✓ Uses Rust 2018 edition

0.1.3 Jan 15, 2020
0.1.2 Oct 8, 2019
0.0.3 Oct 7, 2019
Download history 15/week @ 2020-02-19 18/week @ 2020-02-26 15/week @ 2020-03-04 8/week @ 2020-03-11 28/week @ 2020-03-18 15/week @ 2020-03-25 1/week @ 2020-04-01 30/week @ 2020-04-08 26/week @ 2020-04-15 1/week @ 2020-04-22 1/week @ 2020-04-29 2/week @ 2020-05-06 3/week @ 2020-05-13 34/week @ 2020-05-20 70/week @ 2020-05-27 63/week @ 2020-06-03

57 downloads per month

Custom license

42KB
820 lines

docs.rs crates.io Build Status

Overview

Check the documentation for more details.

A quick summary of features

  • Provides two top-level parsing functions: parse and loose_parse. loose_parse is less strict on the format of the incoming EDI document.
  • Parses a valid X12 EDI document into a struct called EdiDocument.
  • Provides verbose error messages if the document being parsed is invalid.
    • Error messages include the actual segment in which the error occurred.
  • EdiDocument and all data it contains implement Serialize and Deserialize from serde, so zero-copy serialization and deserialization to any serde-able format is supported (this includes json).
  • EdiDocument's fields are all public and it can be navigated like any other struct for simplicity

See the examples directory for an example.

A quick summary of limitations

  • Cannot accurately determine segment types, as that requires an implementation guide from the individual transactor
  • Cannot detect loops for the same reason as above
  • Only supports standard X12 EDI

Roadmap

  • benches to identify regressions
  • output back into EDI with proper padding in the ISA segment
  • iterator over segments for the frequent cases in which there's only one transaction/functional group/interchange (EdiDocument.segments_iter() -> SegmentIter?)
    • to_string(delimiters) is needed to output the edi document

Dependencies

~2.5MB
~40K SLoC