distributed 3.3.0

CQRS/ES framework for Rust using Plain Old Rust Structs — append-only events, replay, snapshots, outbox, service bus, and pluggable infrastructure
Documentation
//! Outbox - Atomic commit of aggregates with publishable outbox messages.
//!
//! This module provides the outbox message type and commit helpers:
//! - `OutboxMessage` - publishable message envelope plus delivery state
//! - `OutboxMessageStatus` - Message status (Pending, InFlight, Published, Failed)
//! - `OutboxCommit` - Helper for aggregate + outbox commits
//!
//! Outbox messages are durable publication work items. Their payload can be a
//! domain event, integration event, command, or generic transport message.
//! Aggregate `EventRecord`s are replayable model history and are not
//! automatically published as domain events.
//!
//! ## Separation of Concerns
//!
//! The outbox pattern has two distinct phases:
//! 1. **Commit phase** (this module) - Atomically commit aggregate event records + outbox message
//! 2. **Worker phase** (see `outbox_worker` module) - Drain outbox and publish messages to external systems
//!
//! Outbox messages are explicit publication records. Aggregate event records are
//! replayable write-side history; they do not automatically become domain or
//! integration events until application code creates an `OutboxMessage` for that
//! publication.
//!
//! ## Example
//!
//! ```ignore
//! use distributed::OutboxMessage;
//!
//! // Create aggregate and domain event outbox message
//! let mut order = Order::new();
//! order.create("order-1", ...);
//!
//! let outbox = OutboxMessage::create("order-1:created", "OrderCreated", payload);
//!
//! // Commit in one async repository batch
//! repo.outbox(outbox).commit(&mut order).await?;
//! ```

mod commit;
mod message;
mod table;

// Outbox message record
pub use message::{OutboxMessage, OutboxMessageStatus};
pub(crate) use table::validate_outbox_message_table_write;
pub use table::{
    outbox_message_insert_plan, outbox_message_key, outbox_message_row_values,
    outbox_message_schema, OUTBOX_MESSAGES_TABLE,
};

// Commit helpers
pub use commit::{AggregateCommit, CommitReceipt, OutboxPublishHook, OutboxPublisherConfig};