Skip to main content

Module prelude

Module prelude 

Source
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:

Re-exports§

pub use crate::context::ClosureContext;
pub use crate::handler::run;

Structs§

BatchItem
A single branch outcome within a BatchResult.
BatchResult
Result of a parallel or map operation containing all branch outcomes.
CallbackHandle
Handle returned by [DurableContext::create_callback] containing the server-generated callback ID.
CallbackOptions
Configure callback timeout behavior.
MapOptions
Configure map operation behavior including batching.
ParallelOptions
Configure parallel execution behavior.
StepOptions
Configure retry behavior for step operations.

Enums§

BatchItemStatus
Status of an individual branch in a parallel operation.
CheckpointResult
Represent the checkpointed outcome of a durable step operation.
CompletionReason
Reason the parallel block completed.
DurableError
Represent all errors that can occur within the durable-lambda SDK.
ExecutionMode
Signal whether the replay engine is replaying from history or executing new operations.

Traits§

DurableContextOps
Shared interface for all durable context types.