Skip to main content

parse_operations

Function parse_operations 

Source
pub fn parse_operations(initial_state: &Value) -> Vec<Operation>
Expand description

Parse operations from the InitialExecutionState JSON payload.

Constructs Operation objects from the JSON "Operations" array using the builder pattern. Operations that cannot be fully parsed are silently skipped.

ยงExamples

let state = serde_json::json!({
    "Operations": [{
        "Id": "op-1",
        "Type": "Step",
        "Status": "Succeeded",
        "StartTimestamp": 1700000000.0,
        "StepDetails": { "Result": "{\"ok\":true}" }
    }]
});
let ops = durable_lambda_core::event::parse_operations(&state);
assert_eq!(ops.len(), 1);