pub struct PlanStep {
pub step_id: StepId,
pub index: i32,
pub description: String,
pub action_type: ActionType,
pub preconditions: Vec<String>,
pub postconditions: Vec<String>,
pub depends_on: Vec<StepId>,
pub estimated_tokens: Option<i32>,
pub status: StepStatus,
}Expand description
A single step in a plan.
Fields§
§step_id: StepIdUnique identifier for this step
index: i32Order in the plan
description: StringDescription of what this step does
action_type: ActionTypeType of action required
preconditions: Vec<String>What must be true before this step
postconditions: Vec<String>What will be true after this step
depends_on: Vec<StepId>Steps this depends on
estimated_tokens: Option<i32>Estimated token cost
status: StepStatusCurrent status
Implementations§
Source§impl PlanStep
impl PlanStep
Sourcepub fn new(
index: i32,
description: impl Into<String>,
action_type: ActionType,
) -> Self
pub fn new( index: i32, description: impl Into<String>, action_type: ActionType, ) -> Self
Create a new plan step.
Sourcepub fn with_precondition(self, condition: impl Into<String>) -> Self
pub fn with_precondition(self, condition: impl Into<String>) -> Self
Add a precondition.
Sourcepub fn with_postcondition(self, condition: impl Into<String>) -> Self
pub fn with_postcondition(self, condition: impl Into<String>) -> Self
Add a postcondition.
Sourcepub fn depends_on(self, step_id: StepId) -> Self
pub fn depends_on(self, step_id: StepId) -> Self
Add a dependency.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlanStep
impl<'de> Deserialize<'de> for PlanStep
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
impl StructuralPartialEq for PlanStep
Auto Trait Implementations§
impl Freeze for PlanStep
impl RefUnwindSafe for PlanStep
impl Send for PlanStep
impl Sync for PlanStep
impl Unpin for PlanStep
impl UnwindSafe for PlanStep
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