Skip to main content

Module eval

Module eval 

Source
Expand description

Condition evaluation traits and expression evaluator.

Re-exports§

pub use answer_lists::AnswerCodeLists;
pub use codelist::ArtikelIdCodelist;
pub use codelist::CodelistColumn;
pub use codelist::MessageFlags;
pub use ebd_cluster::Cluster;
pub use ebd_cluster::EbdClusterLookup;
pub use providers::Clock;
pub use providers::ClockedProvider;
pub use providers::CodeListProvider;
pub use providers::CompositeExternalProvider;
pub use providers::CountryPostalCodeProvider;
pub use providers::KonfigurationenProvider;
pub use providers::MapExternalProvider;
pub use providers::MarketRole;
pub use providers::MarketRoleProvider;
pub use providers::Sector;
pub use providers::SectorProvider;
pub use timezone::dst_transitions_between;
pub use timezone::dtm_after;
pub use timezone::dtm_start_utc_min;
pub use timezone::is_mesz_utc;
pub use timezone::is_mez_utc;
pub use timezone::parse_dtm303;
pub use werktag::compute_easter;
pub use werktag::is_german_holiday;
pub use werktag::is_werktag;
pub use werktag::parse_ccyymmdd_prefix;
pub use werktag::werktage_between;
pub use format_validators::*;

Modules§

abrechnungsdaten
The products of chapter 6.2 of the Codeliste der Konfigurationen, “Produkte zur Bestellung einer Änderung von Abrechnungsdaten”: what an ORDERS 17133 may order in PIA+5 DE7140, and what each product takes in its SG30 — a Produkteigenschaft (CAV+ZH9 DE7110) from its own list, or a Wertedetail (CAV+ZV4 DE7110) of its own format.
answer_lists
Which answer codes each EBD / Codeliste holds.
codelist
BDEW Artikel-ID / Artikelnummer codelist provider.
ebd_cluster
EBD answer-code cluster lookup.
format_validators
Format validation helpers for AHB 900-series conditions.
periods
Zeiträume of a transaction: its SG6 groups, each naming a Zeitraum-ID in RFF DE1156 (UTILMD SG4, UTILTS SG5).
providers
Concrete ExternalConditionProvider implementations.
reading_dates
MSCONS SG10 DTM+7 (Nutzungszeitpunkt) beside DTM+60 / DTM+9: conditions [130] and [133], identical in every MSCONS AHB from 3.1d to 3.2.
sg4_instances
Group instances of one UTILMD SG4 compared with each other.
timezone
DST timezone helpers for German MESZ/MEZ validation.
werktag
German Werktag (working day) arithmetic for BDEW AHB conditions.

Structs§

AbsentTarget
Evaluates conditions for an element or group that is known to be absent.
ConditionExprEvaluator
Evaluates a ConditionExpr AST against an evaluation context.
EvaluationContext
Context passed to condition evaluators during evaluation.
EvaluatorRegistry
Global registry of condition evaluators.
GroupScope
A scope identifying one group instance, by its repetition at every level from the root: [("SG4", 1), ("SG8", 2)] is the third SG8 of the second SG4.
NoOpExternalProvider
A no-op external condition provider that returns Unknown for everything.
NoOpGroupNavigator
A no-op group navigator that returns empty results for all queries.
PresentTarget
Evaluates conditions for an element or group that is known to be present, to decide whether it is allowed there.
StatusResolution
Which status an AHB status applies, see ConditionExprEvaluator::resolve_status.
Vorgang
A transaction (Vorgang) of a message type: the top-level group it repeats as, and where that group’s entry segment carries the transaction’s reference, which an APERAK names in SG5 RFF+TN DE1154.

Enums§

ConditionResult
Three-valued result of evaluating a single condition.

Traits§

ConditionEvaluator
Evaluates individual AHB conditions by number.
ExternalConditionProvider
Provider for external conditions that depend on context outside the EDIFACT message.
GroupNavigator
Provides group-scoped segment access for condition evaluation.

Functions§

binds_once
Whether status limits what it annotates to once per transaction: the condition once is a conjunct of every line (Muss [483] ∧ [2061]). Where it sits in one branch only (Soll [165] ∧ (([2061] ∧ [583]) ∨ [584])), the other branch allows more.
breaks_repetition_limit
Whether count segments under status break a repetition_limits condition the status names and that applies where ctx is.
counted_repetitions
The repetition conditions of a message type whose evaluators count what they limit in the group they name, so that a false one means “sent too often there”: ORDERS [2005] / [2006], “Pro SG29 LIN ist die SG34 RFF+Z09 (Gerätenummer) genau einmal / bis zu dreimal anzugeben”. Most [2000]+ evaluators still count over the whole message; a condition joins this list once its evaluator is verified to count per instance.
is_transaction_group
Whether group_id is a transaction group of message_type, whose conditions the AHB states per transaction. The validator evaluates each repetition against the message as that transaction sees it (mig_assembly::transaction_view, #337).
once_per_transaction
The condition of a message type that allows a group or segment once per transaction, and the transaction group: UTILMD’s [2061] “Segment bzw. Segmentgruppe ist genau einmal je SG4 IDE (Vorgang) anzugeben” (Strom and Gas, FV2504–FV2610). The conditions evaluate it as True wherever there is a transaction, so what it limits — the count — is checked on its own; see binds_once.
packages_allow_none
Whether expr is package terms only, none of which needs a code ([9P0..1]): a status of that kind requires nothing.
presence_condition
The number of a message type’s bare “Wenn vorhanden” condition, if it has one.
presence_conditions
Every condition of a message type that answers “does the annotated thing exist?”, which an absent element or group answers with no.
refuses_count
Whether something present under status is sent more often than it allows where ctx is: refuses_presence does not refuse it, but does once the message type’s counted_repetitions are evaluated. ORDERS 17009’s SG34 Muss ([102] ∧ [2006]) ⊻ ([103] ∧ [2005]) holds for the second RFF+Z09 of a Zähleinrichtung as far as presence goes; [2005] refuses it.
refuses_presence
Whether something present under status is not allowed where ctx is: a Muss/X status with a condition that evaluates to false through PresentTarget. Soll/Kann, an unconditional status, an undecidable condition, a package ([19P1..1], judged by its own check) and a status of several lines refuse nothing.
repetition_limits
The repetition conditions of a message type that set how often a segment is sent in its group instance where they apply, as (condition, min, max): UTILMD Strom [2317] “… CAV+MIW/MPW/MUW vorhanden, ist das Segment mindestens zweimal anzugeben” and [2318] “… CAV+MBW vorhanden, … genau einmal” on the Wandler’s CAV+Z30. Their evaluators say whether one applies there (which also makes the segment required); the count is judged by breaks_repetition_limit.
requiredness
What of expr decides whether something missing must be sent.
transactions
The transactions of a message type, as the APERAK MIG lists them (SG5 RFF+TN DE1154, FV2504–FV2610):