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::Transportfor transient failures — the caller will retry with exponential backoff. - Return
ErpAdapterError::Permanentfor non-retryable failures — the caller will dead-letter the event.
Required Methods§
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.
impl<T: ErpAdapter> ErpAdapter for Arc<T>
Blanket Arc implementation so ErpAdapter can be shared across tasks.