Expand description
User-facing re-exports for the closure-native approach.
Single import for everything needed to write a durable Lambda handler:
use durable_lambda_closure::prelude::*;§Complete Minimal Handler
use durable_lambda_closure::prelude::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
run(|event: serde_json::Value, mut ctx: ClosureContext| async move {
let result: Result<String, String> = ctx.step("greet", || async {
Ok("Hello from durable Lambda!".to_string())
}).await?;
Ok(serde_json::json!({ "greeting": result.unwrap() }))
}).await
}This re-exports:
ClosureContext— the context wrapper for durable operationsrun— the entry point for closure-native handlers- Core types:
DurableError,StepOptions,CallbackOptions,CallbackHandle,ExecutionMode,CheckpointResult
Re-exports§
pub use crate::context::ClosureContext;pub use crate::handler::run;
Structs§
- Batch
Item - A single branch outcome within a
BatchResult. - Batch
Result - Result of a parallel or map operation containing all branch outcomes.
- Callback
Handle - Handle returned by [
DurableContext::create_callback] containing the server-generated callback ID. - Callback
Options - Configure callback timeout behavior.
- MapOptions
- Configure map operation behavior including batching.
- Parallel
Options - Configure parallel execution behavior.
- Step
Options - Configure retry behavior for step operations.
Enums§
- Batch
Item Status - Status of an individual branch in a parallel operation.
- Checkpoint
Result - Represent the checkpointed outcome of a durable step operation.
- Completion
Reason - Reason the parallel block completed.
- Durable
Error - Represent all errors that can occur within the durable-lambda SDK.
- Execution
Mode - Signal whether the replay engine is replaying from history or executing new operations.
Traits§
- Durable
Context Ops - Shared interface for all durable context types.