Public declaration syntax from forge-rs/crates/forge-health/src/checkpoint.rs Original source SHA-256: 4278aab15d1ba4e2d9ad52a050ddda63e433f77c2929b8c408d4e2cf8a91888c Function bodies and constant values are omitted. This is not the complete implementation. Source line 104 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Checkpoint { /// Unique identifier for the operation being checkpointed. /// /// This should be stable across restarts so that a resumed agent can /// find the checkpoint for its in-progress task. pub operation_id: String, /// The step or phase identifier within the operation. /// /// Agent-defined; examples: "phase-2", "page-17", "batch-3-of-10". pub step: String, /// Arbitrary JSON state saved at this checkpoint. /// /// The agent is responsible for interpreting this state on resume. pub state: serde_json::Value, /// Monotonically increasing sequence number for this operation. /// /// Each successive checkpoint for the same `operation_id` should use /// a higher sequence number. pub sequence: u64, /// Timestamp when this checkpoint was created. pub created_at: Timestamp } Source line 153 pub fn new(operation_id: &str, step: &str, state: serde_json::Value) -> Self; Source line 187 pub fn with_sequence( operation_id: &str, step: &str, state: serde_json::Value, sequence: u64, ) -> Self; Source line 217 pub trait CheckpointStore { /// Saves a checkpoint, replacing any existing checkpoint for the same /// `operation_id`. /// /// # Arguments /// /// * `checkpoint` - The [`Checkpoint`] to persist. fn save(&mut self, checkpoint: &Checkpoint); /// Loads the most recent checkpoint for the given operation. /// /// # Arguments /// /// * `operation_id` - The operation identifier to look up. /// /// # Returns /// /// `Some(Checkpoint)` if a checkpoint exists, `None` otherwise. fn load(&self, operation_id: &str) -> Option; /// Deletes all checkpoints for the given operation. /// /// # Arguments /// /// * `operation_id` - The operation identifier to delete. /// /// # Returns /// /// `true` if a checkpoint was found and deleted, `false` otherwise. fn delete(&mut self, operation_id: &str) -> bool; /// Lists all operation IDs that have stored checkpoints. /// /// # Returns /// /// A vector of operation ID strings. fn list(&self) -> Vec; } Source line 277 #[derive(Debug, Clone, Default)] pub struct InMemoryCheckpointStore { } Source line 287 pub fn new() -> Self; Source line 294 pub fn len(&self) -> usize; Source line 299 pub fn is_empty(&self) -> bool;