pub struct WorkflowCheckpoint {
pub schema_version: u32,
pub workflow_id: String,
pub steps: Vec<WorkflowStepRecord>,
pub checkpoint_ms: u64,
}Expand description
Snapshot of a workflow’s completed steps at a step boundary.
(StepOutcome contains a serde_json::Value, which is not Eq, so this
derives PartialEq only.)
Fields§
§schema_version: u32Schema version — see WORKFLOW_CHECKPOINT_SCHEMA_VERSION.
workflow_id: StringLogical workflow identifier the checkpoint is keyed by.
steps: Vec<WorkflowStepRecord>The steps completed so far. A resuming run skips these and re-dispatches only the rest.
checkpoint_ms: u64Wall-clock timestamp when the checkpoint was written (Unix epoch ms).
Implementations§
Source§impl WorkflowCheckpoint
impl WorkflowCheckpoint
Sourcepub fn from_completed(
workflow_id: impl Into<String>,
completed: &HashMap<String, StepOutcome>,
checkpoint_ms: u64,
) -> Self
pub fn from_completed( workflow_id: impl Into<String>, completed: &HashMap<String, StepOutcome>, checkpoint_ms: u64, ) -> Self
Build a checkpoint from a map of completed task_id -> outcome.
Sourcepub fn completed(&self) -> HashMap<String, StepOutcome>
pub fn completed(&self) -> HashMap<String, StepOutcome>
The completed steps as a task_id -> outcome map.
Sourcepub fn ensure_loadable(&self) -> Result<()>
pub fn ensure_loadable(&self) -> Result<()>
Reject a checkpoint written by a newer, incompatible schema version
than this build understands — mirrors
LoopCheckpoint::ensure_loadable.
Field additions are absorbed by #[serde(default)], so older (incl.
pre-v1 0) checkpoints always remain loadable.
Trait Implementations§
Source§impl Clone for WorkflowCheckpoint
impl Clone for WorkflowCheckpoint
Source§fn clone(&self) -> WorkflowCheckpoint
fn clone(&self) -> WorkflowCheckpoint
1.0.0 (const: unstable) · 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>,
Source§impl PartialEq for WorkflowCheckpoint
impl PartialEq for WorkflowCheckpoint
Source§fn eq(&self, other: &WorkflowCheckpoint) -> bool
fn eq(&self, other: &WorkflowCheckpoint) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for WorkflowCheckpoint
impl Serialize for WorkflowCheckpoint
impl StructuralPartialEq for WorkflowCheckpoint
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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