pub struct Scratchpad { /* private fields */ }Expand description
Scratchpad for interrupt handling and transient data storage
Used by the HITL system to track processed interrupts, maintain an audit trail, and store transient data during interrupt handling.
Implementations§
Source§impl Scratchpad
impl Scratchpad
Sourcepub fn is_interrupt_processed(&self, id: &str) -> bool
pub fn is_interrupt_processed(&self, id: &str) -> bool
Sourcepub fn get_null_resume(&self, interrupt_id: &str) -> bool
pub fn get_null_resume(&self, interrupt_id: &str) -> bool
Check if a confirmation-only resume is valid for the given interrupt.
Returns true when the interrupt has already been processed,
meaning the caller can resume without providing an explicit value.
Sourcepub fn mark_interrupt_processed(&mut self, id: &str)
pub fn mark_interrupt_processed(&mut self, id: &str)
Sourcepub fn record_interrupt(&mut self, id: String, node: String, payload: Value)
pub fn record_interrupt(&mut self, id: String, node: String, payload: Value)
Record an interrupt event in the audit trail
Creates a new record with the current timestamp and adds it to the interrupt history.
§Arguments
id- The interrupt IDnode- The node name where the interrupt occurredpayload- The interrupt payload
Sourcepub fn record_resume(&mut self, id: &str, value: Value)
pub fn record_resume(&mut self, id: &str, value: Value)
Record that an interrupt was resumed
Finds the interrupt record by ID and updates it with the resume timestamp and value.
§Arguments
id- The interrupt ID to mark as resumedvalue- The resume value provided
Sourcepub fn interrupt_history(&self) -> &[InterruptRecord]
pub fn interrupt_history(&self) -> &[InterruptRecord]
Get the complete interrupt history
Returns all interrupt records in chronological order.
§Returns
A slice of all interrupt records
Sourcepub fn clear_transient(&mut self)
pub fn clear_transient(&mut self)
Clear transient scratchpad entries
Removes entries that are not persistent (entries not prefixed with
null_resume:). Persistent entries are preserved.
Trait Implementations§
Source§impl Clone for Scratchpad
impl Clone for Scratchpad
Source§fn clone(&self) -> Scratchpad
fn clone(&self) -> Scratchpad
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more