#![allow(clippy::module_inception)]
#![doc = include_str!("../README.md")]
extern crate self as distributed;
pub mod aggregate;
pub mod bus;
pub mod entity;
pub mod repository;
mod commit_builder;
#[cfg(feature = "emitter")]
pub mod emitter;
mod hashmap_repo;
pub mod lock;
pub mod manifest;
pub mod microsvc;
pub mod outbox;
pub mod outbox_worker;
#[cfg(feature = "postgres")]
pub mod postgres_repo;
pub mod queued_repo;
pub mod read_model;
pub mod snapshot;
#[cfg(feature = "sqlite")]
pub mod sqlite_repo;
#[cfg(any(feature = "postgres", feature = "sqlite"))]
mod sqlx_repo;
pub mod table;
pub use entity::{
upcast_events, upcast_payload, BitcodePayloadCodec, Committable, Entity, Event, EventRecord,
EventRecordError, EventUpcaster, LocalEvent, PayloadCodec, UpcastError, BITCODE_PAYLOAD_CODEC,
BITCODE_PAYLOAD_CODEC_VERSION,
};
pub type SourcedResult<T = ()> = std::result::Result<T, EventRecordError>;
pub use repository::{
CommitBatch, GetStream, InboxOutcome, InboxReceipt, InboxStore, PreparedEventAppend,
ReadModelWritePlanStore, RelationalReadModelQueryStore, Repository, RepositoryError,
SnapshotStore, SnapshotWrite, StreamIdentity, StreamWrite, TransactionalCommit,
};
pub use aggregate::{hydrate, Aggregate, AggregateBuilder, AggregateRepository};
pub use hashmap_repo::{HashMapOutboxStore, HashMapRepository};
#[cfg(feature = "postgres")]
pub use postgres_repo::{PostgresOutboxStore, PostgresRepository};
#[cfg(feature = "sqlite")]
pub use sqlite_repo::{SqliteOutboxStore, SqliteRepository};
pub use lock::{
InMemoryLock, InMemoryLockFuture, InMemoryLockManager, Lock, LockError, LockManager,
};
#[cfg(feature = "postgres")]
pub use lock::{PostgresLock, PostgresLockManager};
#[cfg(feature = "sqlite")]
pub use lock::{SqliteLock, SqliteLockManager};
pub use outbox::{
outbox_message_key, outbox_message_schema, AggregateCommit, CommitReceipt, OutboxMessage,
OutboxMessageStatus, OutboxPublishHook, OutboxPublisherConfig, OUTBOX_MESSAGES_TABLE,
};
pub use outbox_worker::{
ClaimOutboxMessages,
DrainResult,
LogPublisher,
LogPublisherError,
OutboxClaimRef,
OutboxPublishFailureAction,
OutboxPublisher,
OutboxStore,
OutboxWorker,
ProcessOneResult,
};
#[cfg(feature = "emitter")]
pub use outbox_worker::LocalEmitterPublisher;
pub use outbox_worker::{
BusOutboxPublishHook, BusPublisher, OutboxDispatchOutcome, OutboxDispatcher, OutboxSource,
ReceivedOutboxMessage, DEFAULT_OUTBOX_SOURCE_BATCH, DEFAULT_OUTBOX_SOURCE_LEASE,
SOURCED_METADATA_PREFIX,
};
pub use queued_repo::{
GetAllWithOpts,
GetWithOpts,
Queueable,
QueuedRepository,
ReadOpts,
UnlockableRepository,
};
pub use read_model::{
ColumnDef, ColumnType, DeleteRowMutation, ExpectedVersion, ForeignKey, InMemoryReadModelStore,
IndexDef, PatchMode, PatchRowMutation, PrimaryKey, ReadModel, ReadModelAdapterCapabilities,
ReadModelCommitOutcome, ReadModelError, ReadModelIncludeRows, ReadModelLoadBuilder,
ReadModelLoadGraph, ReadModelLoadRequest, ReadModelMigrationArtifact, ReadModelMutation,
ReadModelQueryCapabilities, ReadModelSchema, ReadModelSchemaAdapter,
ReadModelSchemaAdapterCapabilities, ReadModelSchemaBootstrap, ReadModelSchemaIssue,
ReadModelSchemaIssueKind, ReadModelSchemaRegistry, ReadModelSchemaVerification,
ReadModelWorkspace, ReadModelWorkspaceExt, ReadModelWritePlan, ReadModelWritePlanBuilder,
RelationalReadModel, RelationalReadModelIncludes, RelationshipDef, RelationshipKind, RowKey,
RowMutation, RowPatch, RowValue, RowValues, RowWriteMode, Versioned,
DEFAULT_READ_MODEL_VERSION_COLUMN,
};
pub use table::TableSchemaRegistry;
pub use manifest::{
DistributedManifestEnvelope, DistributedProjectManifest, MessageEndpointManifest,
ServiceManifest, TransportManifest, DISTRIBUTED_MANIFEST_SCHEMA_VERSION,
};
pub use commit_builder::{
CommitBuilder, CommitBuilderExt, ReadModelWritePlanCommitExt, StagedCommitBuilder,
};
pub use snapshot::{hydrate_from_snapshot, InMemorySnapshotStore, SnapshotRecord, Snapshottable};
#[cfg(feature = "emitter")]
pub use event_emitter_rs::EventEmitter;
pub use distributed_macros::{aggregate, digest, sourced, ReadModel, Snapshot};
#[cfg(feature = "emitter")]
pub use distributed_macros::enqueue;