//! The [`Transact`] unit-of-work trait.
use Future;
use crateDataError;
/// Execute a unit of work atomically.
///
/// Implementations must:
/// * Begin a transaction before calling `f`.
/// * Commit on `Ok(value)`.
/// * Roll back on `Err(e)` and propagate the error.
///
/// The closure `f` returns a `Future` so async operations (queries, lock
/// acquisitions, etc.) can be composed within the transaction boundary.
///
/// # Object safety
///
/// This trait is **not** object-safe because `F` is generic. Use a concrete
/// implementation stored as a value (not `dyn Transact`) or wrap it in a
/// type-erased adapter.