Skip to main content

poprako_orchestra/
lib.rs

1//! # poprako-orchestra — Transaction Abstraction Framework
2//!
3//! Provides a layered set of traits for composing and executing transactional
4//! operations against an abstract backend (a "nucleus"). The crate decouples
5//! three concerns:
6//!
7//! - **What** to do: described by the [`oper::Oper`] trait, which carries the
8//!   operation's input data and declares its [`Output`](oper::Oper::Output)
9//!   type.
10//! - **How** to do it: described by the [`step::Step`] trait, which receives
11//!   an [`Oper`] and a mutable context, executes the operation,
12//!   and returns the output.
13//! - **Where** to run it: described by the [`nucl::Nucl`] trait, which
14//!   provides a managed context scope where the application can execute
15//!   arbitrary async logic with proper error discrimination (backend errors
16//!   vs. step-execution errors).
17//!
18//! ## Layering
19//!
20//! [`Oper`] and [`Step`] together form the
21//! *semantic layer* — they model what your application does inside a
22//! transaction.  [`Nucl`] is the *back-end layer* — it models
23//! the transactional engine (e.g. a database connection pool, a saga
24//! coordinator) that provides the context and handles commit / rollback.
25
26pub mod nucl;
27pub mod oper;
28pub mod step;
29
30pub mod proxy;
31
32pub use nucl::Nucl;
33pub use oper::Oper;
34pub use step::{Run, Step};
35
36pub use proxy::Proxy;