pub struct PlanExecutionState {
pub completed_steps: Vec<String>,
pub failed_steps: Vec<(String, String)>,
pub current_step: usize,
pub replan_attempts: usize,
pub should_continue: bool,
pub last_checkpoint_result: Option<CheckpointResult>,
}Expand description
State of plan execution.
Fields§
§completed_steps: Vec<String>IDs of completed steps.
failed_steps: Vec<(String, String)>Failed steps with error messages.
current_step: usizeCurrent step index.
replan_attempts: usizeNumber of re-plan attempts made.
should_continue: boolWhether execution should continue.
last_checkpoint_result: Option<CheckpointResult>Last checkpoint result.
Implementations§
Source§impl PlanExecutionState
impl PlanExecutionState
Sourcepub fn new() -> PlanExecutionState
pub fn new() -> PlanExecutionState
Create a new execution state.
Sourcepub fn complete_step(&mut self, step_id: impl Into<String>)
pub fn complete_step(&mut self, step_id: impl Into<String>)
Mark a step as completed.
Sourcepub fn fail_step(
&mut self,
step_id: impl Into<String>,
error: impl Into<String>,
)
pub fn fail_step( &mut self, step_id: impl Into<String>, error: impl Into<String>, )
Mark a step as failed.
Sourcepub fn is_completed(&self, step_id: &str) -> bool
pub fn is_completed(&self, step_id: &str) -> bool
Check if a step has been completed.
Sourcepub fn steps_executed(&self) -> usize
pub fn steps_executed(&self) -> usize
Get total steps executed (completed + failed).
Sourcepub fn has_failures(&self) -> bool
pub fn has_failures(&self) -> bool
Check if there are any failures.
Sourcepub fn first_error(&self) -> Option<&str>
pub fn first_error(&self) -> Option<&str>
Get the first error, if any.
Sourcepub fn increment_replan(&mut self)
pub fn increment_replan(&mut self)
Increment re-plan attempts.
Trait Implementations§
Source§impl Clone for PlanExecutionState
impl Clone for PlanExecutionState
Source§fn clone(&self) -> PlanExecutionState
fn clone(&self) -> PlanExecutionState
Returns a duplicate of the value. Read more
1.0.0 · 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 PlanExecutionState
impl Debug for PlanExecutionState
Source§impl Default for PlanExecutionState
impl Default for PlanExecutionState
Source§fn default() -> PlanExecutionState
fn default() -> PlanExecutionState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PlanExecutionState
impl<'de> Deserialize<'de> for PlanExecutionState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlanExecutionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PlanExecutionState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PlanExecutionState
impl Serialize for PlanExecutionState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PlanExecutionState
impl RefUnwindSafe for PlanExecutionState
impl Send for PlanExecutionState
impl Sync for PlanExecutionState
impl Unpin for PlanExecutionState
impl UnwindSafe for PlanExecutionState
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