durable_lambda_builder/prelude.rs
1//! User-facing re-exports for the builder-pattern approach.
2//!
3//! Single import for everything needed to write a durable Lambda handler:
4//!
5//! ```no_run
6//! use durable_lambda_builder::prelude::*;
7//! ```
8//!
9//! # Complete Minimal Handler
10//!
11//! ```no_run
12//! use durable_lambda_builder::prelude::*;
13//!
14//! #[tokio::main]
15//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
16//! handler(|event: serde_json::Value, mut ctx: BuilderContext| 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//! })
22//! .run()
23//! .await
24//! }
25//! ```
26//!
27//! This re-exports:
28//! - [`BuilderContext`] — the context wrapper for durable operations
29//! - [`DurableHandlerBuilder`] — the builder type
30//! - [`handler`](crate::handler) — the constructor function
31//! - Core types: [`DurableError`], [`StepOptions`], [`CallbackOptions`], [`CallbackHandle`],
32//! [`ExecutionMode`], [`CheckpointResult`]
33
34pub use crate::context::BuilderContext;
35pub use crate::handler::{handler, DurableHandlerBuilder};
36pub use durable_lambda_core::error::DurableError;
37pub use durable_lambda_core::ops_trait::DurableContextOps;
38pub use durable_lambda_core::types::{
39 BatchItem, BatchItemStatus, BatchResult, CallbackHandle, CallbackOptions, CheckpointResult,
40 CompletionReason, ExecutionMode, MapOptions, ParallelOptions, StepOptions,
41};