pub struct Plan {
pub id: PlanId,
pub name: String,
pub description: Option<String>,
pub steps: Vec<PlanStep>,
pub decision_points: Vec<DecisionPoint>,
pub metadata: HashMap<String, Value>,
}Expand description
A plan representing a sequence of steps to execute
Fields§
§id: PlanIdUnique identifier for this plan
name: StringHuman-readable name for the plan
description: Option<String>Optional description of what this plan does
steps: Vec<PlanStep>Steps to execute in this plan
decision_points: Vec<DecisionPoint>Decision points where Claude can make runtime decisions
metadata: HashMap<String, Value>Additional metadata
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn new(id: PlanId, name: impl Into<String>) -> Self
pub fn new(id: PlanId, name: impl Into<String>) -> Self
Create a new plan with the given ID and name
Sourcepub fn get_decision_point(
&self,
decision_id: &DecisionId,
) -> Option<&DecisionPoint>
pub fn get_decision_point( &self, decision_id: &DecisionId, ) -> Option<&DecisionPoint>
Get a decision point by its ID
Sourcepub fn get_ready_steps(&self, completed: &HashSet<StepId>) -> Vec<&PlanStep>
pub fn get_ready_steps(&self, completed: &HashSet<StepId>) -> Vec<&PlanStep>
Get all steps whose dependencies are satisfied
Returns steps that:
- Have all dependencies in the
completedset - Are not themselves in the
completedset
Sourcepub fn topological_order(&self) -> Option<Vec<StepId>>
pub fn topological_order(&self) -> Option<Vec<StepId>>
Return steps in valid topological execution order
Returns None if the plan has a dependency cycle.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plan
impl<'de> Deserialize<'de> for Plan
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 Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnwindSafe for Plan
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