pub struct Checkpoint {
pub id: u64,
pub workflow_id: String,
pub timestamp_secs: u64,
pub completed_tasks: Vec<String>,
pub running_tasks: Vec<String>,
pub state_data: HashMap<String, String>,
pub label: Option<String>,
}Expand description
A snapshot of workflow execution state at a point in time.
Fields§
§id: u64Unique checkpoint identifier.
workflow_id: StringID of the workflow this checkpoint belongs to.
timestamp_secs: u64Unix timestamp (seconds) when the checkpoint was taken.
completed_tasks: Vec<String>IDs of tasks that had completed at checkpoint time.
running_tasks: Vec<String>IDs of tasks that were running at checkpoint time.
state_data: HashMap<String, String>Arbitrary key-value state to persist (e.g. intermediate outputs).
label: Option<String>Human-readable label (optional).
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn new(id: u64, workflow_id: impl Into<String>) -> Self
pub fn new(id: u64, workflow_id: impl Into<String>) -> Self
Creates a new checkpoint with the current timestamp.
Sourcepub fn set_state(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn set_state(&mut self, key: impl Into<String>, value: impl Into<String>)
Sets a state key-value pair.
Sourcepub fn is_task_completed(&self, task_id: &str) -> bool
pub fn is_task_completed(&self, task_id: &str) -> bool
Returns true if a given task was completed at this checkpoint.
Sourcepub fn task_count(&self) -> usize
pub fn task_count(&self) -> usize
Returns the total number of tasks (completed + running).
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Checkpoint
impl Debug for Checkpoint
Source§impl<'de> Deserialize<'de> for Checkpoint
impl<'de> Deserialize<'de> for Checkpoint
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Checkpoint
impl PartialEq for Checkpoint
Source§impl Serialize for Checkpoint
impl Serialize for Checkpoint
impl StructuralPartialEq for Checkpoint
Auto Trait Implementations§
impl Freeze for Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
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
Mutably borrows from an owned value. Read more