1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! # edifact-mapper
//!
//! EDIFACT to BO4E bidirectional conversion for the German energy market.
//!
//! This crate provides a high-level [`Mapper`] API that loads precompiled
//! [`DataBundle`] files and exposes [`ConversionService`] and [`MappingEngine`]
//! instances for specific format versions, message variants, and PIDs.
//!
//! # Quick Start — Outbound (BO4E → EDIFACT)
//!
//! ```ignore
//! use edifact_mapper::{DataDir, Mapper};
//!
//! let mapper = Mapper::from_data_dir(DataDir::auto())?;
//!
//! let edifact = mapper.to_edifact(
//! &msg_stammdaten, &tx_stammdaten,
//! "FV2504", "UTILMD_Strom", "55001",
//! )?;
//! ```
//!
//! # Quick Start — Inbound (EDIFACT → BO4E)
//!
//! For inbound messages where the PID is not known upfront, use
//! [`Mapper::detect_pid`] to extract it from the EDIFACT content:
//!
//! ```ignore
//! use edifact_mapper::{DataDir, Mapper};
//!
//! let mapper = Mapper::from_data_dir(DataDir::auto())?;
//!
//! // Step 1: Detect PID from raw EDIFACT (reads RFF+Z13 or BGM+STS)
//! let pid = mapper.detect_pid(edifact_str)?;
//!
//! // Step 2: Convert to typed BO4E interchange
//! let interchange: DynamicInterchange =
//! mapper.from_edifact(edifact_str, "FV2504", "UTILMD_Strom", &pid)?;
//! ```
//!
//! # Mid-level Access
//!
//! For advanced use cases, key types from internal crates are re-exported:
//!
//! - [`ConversionService`] — tokenize EDIFACT input and assemble MIG trees
//! - [`MappingEngine`] — convert between MIG trees and BO4E JSON
//! - [`DataBundle`] / [`VariantCache`] — precompiled mapping data
//! - [`edifact_parser`] — standalone EDIFACT parser (no BO4E dependency)
pub use validate_with_conditions;
pub use DataDir;
pub use ;
pub use ;
// Re-export key types from internal crates for mid-level access.
pub use AssembledTree;
pub use ConversionService;
pub use ;
pub use MappingEngine;
// Re-export PID validation types.
pub use ;
// AHB validation types for `Mapper::validate_edifact` / `Mapper::validate_bo4e`
// callers. The AHB report is a distinct type from the BO4E `ValidationReport`
// above, so it is re-exported under a non-clashing name.
pub use ;
// The display layer: narrating a `ValidationIssue`'s `kind` into words, for
// callers that want the legacy `message`/`code`/`category` shape (a display
// boundary — see `automapper_validation::display`). `IssueKind` and
// `ValidationCategory` are re-exported above so a consumer can implement
// `IssueView`/`IssueNarrator` for a world of their own — `StructureDiagnosticKind`
// below completes that, since `IssueKind::StructureDiagnostic`'s `kind` field
// is that type.
pub use display;
// Assembly diagnostics for `Mapper::from_edifact_with_diagnostics` callers.
pub use ;
// Re-export reverse pipeline types for BO4E → EDIFACT conversion.
pub use EdifactDelimiters;
pub use Disassembler;
pub use filter_mig_for_pid;
pub use render_edifact;
pub use ;
// Re-export the parser for standalone use.
pub use edifact_parser;