pub struct ValidationIssueSummary {Show 15 fields
pub severity: &'static str,
pub message: String,
pub rule_id: Option<String>,
pub error_code: Option<String>,
pub segment_tag: Option<String>,
pub segment_occurrence: Option<u16>,
pub segment_group: Option<String>,
pub element_index: Option<u8>,
pub component_index: Option<u8>,
pub message_ref: Option<String>,
pub suggestion: Option<String>,
pub offset: Option<usize>,
pub byte_end: Option<usize>,
pub pruefidentifikator: Option<u32>,
pub rule_origin: Option<&'static str>,
}Expand description
The mako-facing projection of a single edifact_rs::ValidationIssue.
ValidationIssue is already owned and serializable; this type exists to shape
the mako serialization contract — camelCase field names, a curated field set,
severity as a stable string, and two derived fields the raw issue does not carry
(rule_origin and the resolved pruefidentifikator).
Unconditionally available (no feature gate required). The serde feature
adds #[derive(Serialize)] so instances can be JSON-encoded directly.
Fields§
§severity: &'static strSeverity string: "critical", "error", "warning", or "info".
message: StringHuman-readable description of the issue.
rule_id: Option<String>Stable rule identifier (e.g. "MIG-DTM-001" or "AHB-13001-STS-I0"),
if available.
error_code: Option<String>Stable error code assigned by the validator, if any.
segment_tag: Option<String>Tag of the EDIFACT segment where the issue occurred, e.g. "DTM".
segment_occurrence: Option<u16>0-based index of the occurrence among all segments with segment_tag.
segment_group: Option<String>Segment group name in which the issue occurred (e.g. "SG4"), if available.
Populated from edifact_rs::ValidationIssue::segment_group.
element_index: Option<u8>0-based data-element index within the segment.
component_index: Option<u8>0-based component index within a composite data element.
message_ref: Option<String>UNH message reference (DE 0062) the issue belongs to.
suggestion: Option<String>Suggested remediation text, if available.
offset: Option<usize>Byte offset of the first byte of the affected region in the source input.
The start of edifact_rs::ValidationIssue::span.
byte_end: Option<usize>Exclusive byte offset of the end of the affected region in the source input.
Together with offset this forms a half-open byte range
[offset, byte_end) that maps directly to an LSP Range or a miette
source span. None when the issue has no span.
pruefidentifikator: Option<u32>The BDEW Prüfidentifikator (process variant code) associated with this issue, when the report was produced by a PID-specific validation layer.
This field enables downstream audit logs and monitoring systems to identify which BDEW process variant triggered a violation without re-reading the raw EDIFACT message — satisfying the regulatory traceability requirement for German energy market participants.
None when the validation layer does not use PID-gated rule packs
(e.g. structural Layer 1–2 checks that apply to all process variants).
rule_origin: Option<&'static str>Validation layer that generated this issue.
Classifies the issue by its origin in the layered validation stack:
| Value | Layer | Meaning |
|---|---|---|
"parse" | L1 | EDIFACT parse / tokenizer error |
"directory" | L2 | Directory check (segment definitions, code lists) |
"mig" | L3 | MIG structural rule (segment ordering, cardinality) |
"ahb" | L4–L5 | AHB Bedingungsoperator rule |
"custom" | L6 | Caller-supplied CustomRulePack rule |
Used by monitoring dashboards and regulatory audit systems to distinguish sender-side malformed EDI (L1–L2) from conformance violations (L3–L5) from local business-rule failures (L6).
Derived from the rule_id prefix heuristic:
"MIG-"prefix →"mig","AHB-"→"ahb","PARSE-"→"parse","DIR-"→"directory","CUSTOM-"→"custom".Nonewhen therule_idis absent or does not match a known prefix.
Implementations§
Source§impl ValidationIssueSummary
impl ValidationIssueSummary
Sourcepub fn from_issue_with_pid(
issue: &ValidationIssue,
pruefidentifikator: Option<u32>,
) -> Self
pub fn from_issue_with_pid( issue: &ValidationIssue, pruefidentifikator: Option<u32>, ) -> Self
Convert a ValidationIssue to a ValidationIssueSummary, tagging it
with the Prüfidentifikator that was active during validation.
The PID is resolved in priority order:
issue.context_get("pid")— set per-issue by AHB rule closures viawith_context_entry("pid", …).pruefidentifikator— report-level fallback for callers that set the PID on the report rather than on individual issues.
Use this from EdiEnergyReport::serialize so every serialized issue
carries the PID context needed for regulatory audit logs.
Trait Implementations§
Source§impl Clone for ValidationIssueSummary
impl Clone for ValidationIssueSummary
Source§fn clone(&self) -> ValidationIssueSummary
fn clone(&self) -> ValidationIssueSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more