Expand description
edi-energy — EDI@Energy EDIFACT parser and validator for the German energy market.
§Quick start
use edi_energy::{Platform, AnyMessage, EdiEnergyMessage};
let input: &[u8] = b"UNB+UNOA:3+SENDER+RECEIVER+200101:0900+1'UNH+1+UTILMD:D:11A:UN:S2.2'BGM+E01+11001+9'UNT+2+1'UNZ+1+1'";
let msg = Platform::with_all_profiles().parse(input)?;
let report = msg.validate()?;
assert!(report.is_valid());§Supported releases
This crate ships built-in profiles for the S-track (Strom) and
G-track (Gas) UTILMD releases introduced by the 2024 format split:
S2.1, S2.2 (Strom) and G1.1, G1.2 (Gas).
Classic UTILMD releases (5.5.x) — messages with wire release codes such
as 5.5.3a, 5.5.4a, 5.5.5a, 5.5.6a, 5.5.7a, or 5.5.8a — can be
parsed (the EDIFACT segment structure is read and typed fields extracted)
but cannot be validated: AnyMessage::validate and
AnyMessage::validate_against return Error::ProfileNotFound for any
classic-track release because no 5.5.x MIG/AHB profiles are bundled.
If you need validation support for classic-track archive messages, build
and register custom registry::Profile implementations for those releases.
Re-exports§
pub use registry::ProcessContext;pub use registry::ReleaseRegistry;pub use registry::TRANSITION_GRACE_DAYS;pub use registry::TransitionState;pub use messages::aperak::AperakError;pub use messages::contrl::ContrlElementError;pub use messages::contrl::ContrlMessageResponse;pub use messages::contrl::ContrlSegmentError;pub use messages::mscons::MsconsDeliveryPoint;pub use messages::mscons::MsconsLineItem;pub use messages::mscons::MsconsQuantity;pub use messages::mscons::MsconsReference;pub use messages::mscons::MsconsTimeSeries;pub use messages::utilmd::UtilmdReference;pub use messages::utilmd::UtilmdTransaction;
Modules§
- builders
- Fluent builder APIs for constructing EDI@Energy messages. Fluent builder APIs for constructing EDI@Energy messages from scratch.
- messages
- Concrete EDI@Energy message type structs, one sub-module per message type.
- registry
- Profile registry mapping
(MessageType, Release)pairs to validation rules. - releases
- Well-known release identifiers for all registered profiles.
Structs§
- Custom
Rule Pack - A caller-supplied validation rule pack that can be merged on top of all
built-in validation layers when calling
EdiEnergyMessage::validate_with_pack. - EdiEnergy
Report - The result of validating an EDI@Energy message.
- Interchange
Header - Parsed UNB interchange envelope header fields.
- Interchange
Iter - Lazy iterator over
MessageEnvelopes from a parsed EDIFACT interchange. - Light
Message - Envelope-only view of a parsed EDIFACT/EDI@Energy message.
- Message
Envelope - A single parsed message together with its enclosing interchange envelope header.
- Parse
Config - Configuration for the EDIFACT byte-slice parser.
- Parsed
Interchange - A fully parsed EDIFACT interchange with envelope metadata preserved.
- Parser
- A configured parser for EDI@Energy messages and interchanges.
- Platform
- An explicit EDI@Energy processing context.
- Pruefidentifikator
- A validated EDI@Energy Pruefidentifikator (document-identifier code).
- Reader
Config - Configuration for reader-based EDIFACT parsers.
- Receipt
Context - Context needed to build an acknowledgement (APERAK / CONTRL) for a received message.
- Release
- The EDI@Energy release / association-code identifier extracted from the UNH segment.
- Validation
Issue - A structured validation issue.
- Validation
Issue Summary - The mako-facing projection of a single
edifact_rs::ValidationIssue. - Validation
Report - A collection of validation results: errors, warnings, and informational notes.
Enums§
- Agency
Code - EDIFACT DE 3055 — code list responsible agency for market participant identification.
- AnyMessage
- A parsed EDI@Energy message, dispatched to its concrete type.
- Error
- All errors that can be produced by
edi-energy. - Message
Type - EDIFACT message type codes used in the German energy market (EDI@Energy).
- Object
Type - Domain type for BDEW object-type qualifier codes (EDIFACT DE 7495).
- Profile
Error - Errors that arise from a malformed or incomplete profile configuration.
- Release
Kind - Parsed structure of an EDI@Energy release code.
- Release
Track - Coarse track classification for a BDEW EDI@Energy release code.
- Validation
Severity - Priority level for a validation error or warning.
Constants§
- DEFAULT_
MAX_ SEGMENT_ BYTES - Default per-segment byte limit for
ParseConfig.
Traits§
- EdiEnergy
Message - Core abstraction for all EDI@Energy message types.
- Edifact
Deserialize - Types that can be deserialized from a slice of EDIFACT segments.
- Edifact
Serialize - Types that can serialize themselves to an EDIFACT event stream.
Functions§
- parse
- Parse a single EDIFACT message from a byte slice using the global registry.
- parse_
envelope_ only - Parse only the UNH/BGM envelope fields from a byte slice, without constructing typed message structs.
- parse_
interchange - Parse all messages from an interchange using the global registry.
- validate_
and_ check_ pid - Validate
msgand additionally enforce that its Prüfidentifikator matchesexpected.
Derive Macros§
- Edifact
Deserialize - Derive
edifact_rs::EdifactDeserializefor segment or message structs. - Edifact
Serialize - Derive
edifact_rs::EdifactSerializefor segment or message structs.