pub struct PlanExecution {
pub id: ExecutionId,
pub plan_id: PlanId,
pub state: ExecutionState,
pub step_results: HashMap<StepId, StepResult>,
pub decisions: HashMap<DecisionId, RecordedDecision>,
pub started_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
}Expand description
The execution state of a plan
Fields§
§id: ExecutionIdUnique identifier for this execution
plan_id: PlanIdThe plan being executed
state: ExecutionStateCurrent state of the execution
step_results: HashMap<StepId, StepResult>Results of completed steps
decisions: HashMap<DecisionId, RecordedDecision>Decisions made during execution
started_at: DateTime<Utc>When this execution started
completed_at: Option<DateTime<Utc>>When this execution completed (if completed)
Implementations§
Source§impl PlanExecution
impl PlanExecution
Sourcepub fn new(id: ExecutionId, plan: &Plan) -> Self
pub fn new(id: ExecutionId, plan: &Plan) -> Self
Create a new plan execution
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the execution is complete
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the execution is successful
Sourcepub fn get_step_result(&self, step_id: &StepId) -> Option<&StepResult>
pub fn get_step_result(&self, step_id: &StepId) -> Option<&StepResult>
Get the result for a specific step
Sourcepub fn record_step_result(&mut self, step_id: StepId, result: StepResult)
pub fn record_step_result(&mut self, step_id: StepId, result: StepResult)
Record a step result
Sourcepub fn record_decision(
&mut self,
decision_id: DecisionId,
decision: RecordedDecision,
)
pub fn record_decision( &mut self, decision_id: DecisionId, decision: RecordedDecision, )
Record a decision
Trait Implementations§
Source§impl Clone for PlanExecution
impl Clone for PlanExecution
Source§fn clone(&self) -> PlanExecution
fn clone(&self) -> PlanExecution
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 PlanExecution
impl Debug for PlanExecution
Source§impl<'de> Deserialize<'de> for PlanExecution
impl<'de> Deserialize<'de> for PlanExecution
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
Auto Trait Implementations§
impl Freeze for PlanExecution
impl RefUnwindSafe for PlanExecution
impl Send for PlanExecution
impl Sync for PlanExecution
impl Unpin for PlanExecution
impl UnwindSafe for PlanExecution
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