1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! # `Blazen` Persistence
//!
//! Provides checkpoint storage for workflow state, enabling pause/resume and
//! crash recovery.
//!
//! ## Backends
//!
//! Two storage backends are available behind feature flags:
//!
//! | Feature | Backend | Description |
//! |---------|---------|-------------|
//! | `redb` (default) | [`RedbCheckpointStore`] | Embedded, pure-Rust ACID key-value store |
//! | `valkey` | [`valkey::ValkeyCheckpointStore`] | Redis/ValKey server-backed store |
//!
//! ## Quick start (redb)
//!
//! ```rust,no_run
//! use blazen_persist::{CheckpointStore, RedbCheckpointStore, WorkflowCheckpoint};
//!
//! # async fn example() -> Result<(), blazen_persist::PersistError> {
//! let store = RedbCheckpointStore::new("workflow.db")?;
//!
//! // Save a checkpoint
//! # let checkpoint = WorkflowCheckpoint {
//! # workflow_name: "demo".into(),
//! # run_id: uuid::Uuid::new_v4(),
//! # timestamp: chrono::Utc::now(),
//! # state: Default::default(),
//! # pending_events: vec![],
//! # metadata: Default::default(),
//! # };
//! store.save(&checkpoint).await?;
//!
//! // Load it back
//! let loaded = store.load(&checkpoint.run_id).await?;
//! # Ok(())
//! # }
//! ```
// Always-available exports (trait + data types + error).
pub use ;
pub use PersistError;
// Backend-specific re-exports.
pub use RedbCheckpointStore;