Expand description
Cross-module integration — adapters, anti-corruption layer, and event bridges.
Modules MUST NOT share entities. When module A needs data from module B,
it defines an External projection and a ModuleAdapter that maps from
B’s published types into A’s internal types.
§Pattern
Module B publishes: UserCreatedEvent { user_id, email }
Module A adapts: CustomerCreatedEvent { customer_id, contact_email }
impl ModuleAdapter<UserCreatedEvent, CustomerCreatedEvent>
for SapiensToCorpusAdapter { ... }This keeps bounded contexts decoupled while allowing event-driven integration.
§Module identification
Adapters expose source_module() and target_module() so the framework
can log, trace, and validate cross-context data flows.
Structs§
- Event
Bridge - Bridges domain events from module A into module B by adapting and re-publishing.
- Identity
Adapter - An adapter that maps a type to itself — useful when module A re-publishes its own event with no transformation.
Enums§
- Integration
Error - Standard error for integration/adapter failures.
Traits§
- Module
Adapter - Bidirectional adapter between an external module’s type and this module’s type.
- Projection
Adapter - Synchronous adapter for pure data projections (no async needed).
Functions§
- identity_
adapter - Helper: build an
IdentityAdapterwithout importing the type name.