Skip to main content

durable_lambda_closure/
prelude.rs

1//! User-facing re-exports for the closure-native approach.
2//!
3//! Single import for everything needed to write a durable Lambda handler:
4//!
5//! ```no_run
6//! use durable_lambda_closure::prelude::*;
7//! ```
8//!
9//! # Complete Minimal Handler
10//!
11//! ```no_run
12//! use durable_lambda_closure::prelude::*;
13//!
14//! #[tokio::main]
15//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
16//!     run(|event: serde_json::Value, mut ctx: ClosureContext| async move {
17//!         let result: Result<String, String> = ctx.step("greet", || async {
18//!             Ok("Hello from durable Lambda!".to_string())
19//!         }).await?;
20//!         Ok(serde_json::json!({ "greeting": result.unwrap() }))
21//!     }).await
22//! }
23//! ```
24//!
25//! This re-exports:
26//! - [`ClosureContext`] — the context wrapper for durable operations
27//! - [`run`](crate::run) — the entry point for closure-native handlers
28//! - Core types: [`DurableError`], [`StepOptions`], [`CallbackOptions`], [`CallbackHandle`],
29//!   [`ExecutionMode`], [`CheckpointResult`]
30
31pub use crate::context::ClosureContext;
32pub use crate::handler::run;
33pub use durable_lambda_core::error::DurableError;
34pub use durable_lambda_core::ops_trait::DurableContextOps;
35pub use durable_lambda_core::types::{
36    BatchItem, BatchItemStatus, BatchResult, CallbackHandle, CallbackOptions, CheckpointResult,
37    CompletionReason, ExecutionMode, MapOptions, ParallelOptions, StepOptions,
38};