Skip to main content

ErpAdapter

Trait ErpAdapter 

Source
pub trait ErpAdapter:
    Send
    + Sync
    + 'static {
    // Required method
    async fn notify(&self, event: ErpEvent) -> Result<(), ErpAdapterError>;
}
Expand description

Outbound notification sink — mako-engine calls this when a process event should be reported to the ERP.

The payload is always a BO4E-typed JSON object; the adapter never receives raw EDIFACT bytes or format-version identifiers.

§Contract

  • Must be idempotent on event.idempotency_key. Called twice with the same key must succeed without double-posting.
  • Return ErpAdapterError::Transport for transient failures — the caller will retry with exponential backoff.
  • Return ErpAdapterError::Permanent for non-retryable failures — the caller will dead-letter the event.

Required Methods§

Source

async fn notify(&self, event: ErpEvent) -> Result<(), ErpAdapterError>

Deliver event to the ERP.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ErpAdapter> ErpAdapter for Arc<T>

Blanket Arc implementation so ErpAdapter can be shared across tasks.

Source§

async fn notify(&self, event: ErpEvent) -> Result<(), ErpAdapterError>

Implementors§