Skip to main content

ExternalConditionProvider

Trait ExternalConditionProvider 

Source
pub trait ExternalConditionProvider: Send + Sync {
    // Required method
    fn evaluate(&self, condition_name: &str) -> ConditionResult;

    // Provided method
    fn now(&self) -> DateTime<Utc> { ... }
}
Expand description

Provider for external conditions that depend on context outside the EDIFACT message.

External conditions are things like:

  • [1] “Wenn Aufteilung vorhanden” (message splitting status)
  • [14] “Wenn Datum bekannt” (whether a date is known)
  • [30] “Wenn Antwort auf Aktivierung” (response to activation)

These cannot be determined from the EDIFACT content alone and require business context from the calling system.

Required Methods§

Source

fn evaluate(&self, condition_name: &str) -> ConditionResult

Evaluate an external condition by name.

The condition_name corresponds to the speaking name from the generated external conditions constants (e.g., “MessageSplitting”, “DateKnown”).

Provided Methods§

Source

fn now(&self) -> DateTime<Utc>

The present moment, for conditions that compare against it: UTILMD [494] “das hier genannte Datum muss der Zeitpunkt sein, zu dem das Dokument erstellt wurde, oder ein Zeitpunkt, der davor liegt”. The wall clock by default; a caller on a simulated clock overrides it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§