Crate legend

Crate legend 

Source
Expand description

Legend — strict composable sagas for sequential workflows.

§Design Goals

Legend is focused on compile-time guarantees:

  • HList-based sequences: Empty programs are compile errors, not runtime panics
  • Typestate execution: Invalid state transitions are caught at compile time
  • Strict compensation: No silent failures - compensation must explicitly succeed or fail

§Core Concepts

  • Step: A single operation with execute and compensate
  • Execution: Runtime state with typestate tracking (New, Paused, Completed, Failed)

Re-exports§

pub use execution::Completed;
pub use execution::Execution;
pub use execution::ExecutionPhase;
pub use execution::ExecutionResult;
pub use execution::ExecutionState;
pub use execution::Failed;
pub use execution::New;
pub use execution::Paused;
pub use execution::StepStatus;
pub use execution::StepTiming;
pub use hlist::BlockResult;
pub use hlist::HCons;
pub use hlist::HNil;
pub use hlist::HSingle;
pub use hlist::InstructionList;
pub use step::CompensationOutcome;
pub use step::RetryPolicy;
pub use step::Step;
pub use step::StepOutcome;
pub use step::StepWrapper;
pub use store::ExecutionId;
pub use store::InMemoryStore;
pub use store::PausedRecord;
pub use store::Store;
pub use store::StoreError;
pub use paste;

Modules§

execution
Execution state types with typestate pattern.
hlist
Heterogeneous list types for compile-time validated instruction sequences.
step
Step trait and related types for the strict saga VM.
store
Core storage types and traits for persisting paused executions.

Macros§

block
Define a reusable block of steps.
legend
Define a saga program entry point.