Expand description
§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
ⓘ
use edifact_mapper::{DataDir, Mapper};
// Auto-detect data directory ($EDIFACT_DATA_DIR or ~/.edifact/data)
let mapper = Mapper::from_data_dir(DataDir::auto())?;
// Or explicit path with eager loading
let mapper = Mapper::from_data_dir(
DataDir::path("/opt/edifact/data").eager(&["FV2504"])
)?;
// Get a conversion service for EDIFACT parsing + MIG assembly
let cs = mapper.conversion_service("FV2504", "UTILMD_Strom")?;
// Get a mapping engine for a specific PID
let engine = mapper.engine("FV2504", "UTILMD_Strom", "55001")?;§Mid-level Access
For advanced use cases, key types from internal crates are re-exported:
ConversionService— tokenize EDIFACT input and assemble MIG treesMappingEngine— convert between MIG trees and BO4E JSONDataBundle/VariantCache— precompiled mapping dataedifact_parser— standalone EDIFACT parser (no BO4E dependency)
Re-exports§
pub use data_dir::DataDir;pub use error::MapperError;pub use mapper::Bo4eResult;pub use mapper::Mapper;pub use edifact_parser;
Modules§
- data_
dir - Data directory configuration for locating DataBundle files on disk.
- error
- Error types for the edifact-mapper facade crate.
- evaluator_
factory - Factory for creating condition evaluators by variant name and format version.
- mapper
- High-level
MapperAPI for EDIFACT-to-BO4E conversion.
Structs§
- Assembled
Tree - A generic assembled tree node (before PID-specific typing).
- Conversion
Service - High-level service that holds a parsed MIG schema and provides convenient methods for EDIFACT conversion.
- Data
Bundle - Bundled data for a single format version (e.g., FV2504).
- Mapping
Engine - The mapping engine holds all loaded mapping definitions and provides methods for bidirectional conversion.
- Validation
Report - A collection of validation errors for a PID.
- Variant
Cache - Precompiled cache for a single format-version/variant (e.g., FV2504/UTILMD_Strom).
Enums§
- PidValidation
Error - A single PID validation error.
Functions§
- validate_
with_ conditions - Validate a BO4E JSON value against PID requirements with AHB condition awareness.