aion_store/lib.rs
1//! Persistence contracts and in-memory event stores for Aion durable workflows.
2//!
3//! The crate defines the async event-store traits used by the engine, visibility
4//! records for workflow listings, timer records, run-chain summaries, and a
5//! correct `InMemoryStore` reference implementation for tests and development.
6//!
7//! # Example
8//!
9//! ```
10//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
11//! use aion_store::{InMemoryStore, ReadableEventStore, WorkflowId};
12//!
13//! let store = InMemoryStore::default();
14//! let workflow_id = WorkflowId::new_v4();
15//! let history = store.read_history(&workflow_id).await?;
16//! assert!(history.is_empty());
17//! # Ok(())
18//! # }
19//! ```
20
21/// Backend conformance helpers shared by event-store implementations.
22pub mod conformance;
23/// Store-level error taxonomy.
24pub mod error;
25/// In-memory reference implementation of the store contracts.
26pub mod memory;
27/// Deployed-package persistence records and contract.
28pub mod package;
29/// Run-chain summaries used for workflow execution lineage.
30pub mod run_chain;
31/// Core readable and writable event-store traits.
32pub mod store;
33/// Timer persistence records and queries.
34pub mod timer;
35/// Workflow visibility records, predicates, and list filters.
36pub mod visibility;
37
38pub use aion_core::{
39 ContentType, Event, EventEnvelope, Payload, TimerId, WorkflowError, WorkflowFilter, WorkflowId,
40 WorkflowStatus, WorkflowSummary, status_from_events,
41};
42pub use error::StoreError;
43pub use memory::InMemoryStore;
44pub use package::{PackageRecord, PackageRouteRecord, PackageStore};
45pub use store::{EventStore, ReadableEventStore, RunSummary, WritableEventStore, WriteToken};
46pub use timer::TimerEntry;
47pub use visibility::{
48 ListWorkflowsFilter, SearchAttributePredicate, VisibilityRecord, VisibilityStore,
49 WorkflowSummary as VisibilityWorkflowSummary,
50};