pub struct WorkflowCheckpoint {
pub id: CheckpointId,
pub workflow_id: String,
pub sequence: u64,
pub timestamp: DateTime<Utc>,
pub completed_tasks: Vec<TaskId>,
pub failed_tasks: Vec<TaskId>,
pub current_position: usize,
pub total_tasks: usize,
pub checksum: String,
pub task_ids_checksum: String,
}Expand description
Snapshot of workflow execution state at a point in time.
Stores completed tasks, failed tasks, current execution position, and includes SHA-256 checksum for integrity validation.
Fields§
§id: CheckpointIdUnique checkpoint identifier
workflow_id: StringWorkflow this checkpoint belongs to
sequence: u64Checkpoint sequence number (monotonically increasing)
timestamp: DateTime<Utc>Timestamp when checkpoint was created
completed_tasks: Vec<TaskId>Tasks that have completed successfully
failed_tasks: Vec<TaskId>Tasks that have failed
current_position: usizeCurrent position in execution order
total_tasks: usizeTotal number of tasks in workflow
checksum: StringSHA-256 checksum for integrity verification
task_ids_checksum: StringChecksum of task IDs for graph drift detection
Implementations§
Source§impl WorkflowCheckpoint
impl WorkflowCheckpoint
Sourcepub fn from_executor(
workflow_id: impl Into<String>,
sequence: u64,
executor: &WorkflowExecutor,
position: usize,
) -> Self
pub fn from_executor( workflow_id: impl Into<String>, sequence: u64, executor: &WorkflowExecutor, position: usize, ) -> Self
Creates a checkpoint from current executor state.
Captures the current execution state including completed tasks, failed tasks, and current position. Computes SHA-256 checksum for integrity validation.
§Arguments
workflow_id- Workflow identifiersequence- Checkpoint sequence numberexecutor- Reference to workflow executorposition- Current position in execution order
Sourcepub fn validate(&self) -> Result<(), WorkflowError>
pub fn validate(&self) -> Result<(), WorkflowError>
Validates the checkpoint’s checksum.
Verifies that the stored checksum matches the computed checksum of the checkpoint data. Returns an error if checksums don’t match.
§Returns
Ok(())if checksum is validErr(WorkflowError)if checksum mismatch detected
Trait Implementations§
Source§impl Clone for WorkflowCheckpoint
impl Clone for WorkflowCheckpoint
Source§fn clone(&self) -> WorkflowCheckpoint
fn clone(&self) -> WorkflowCheckpoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowCheckpoint
impl Debug for WorkflowCheckpoint
Source§impl<'de> Deserialize<'de> for WorkflowCheckpoint
impl<'de> Deserialize<'de> for WorkflowCheckpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WorkflowCheckpoint
impl RefUnwindSafe for WorkflowCheckpoint
impl Send for WorkflowCheckpoint
impl Sync for WorkflowCheckpoint
impl Unpin for WorkflowCheckpoint
impl UnsafeUnpin for WorkflowCheckpoint
impl UnwindSafe for WorkflowCheckpoint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more