pub struct Plan {
pub goal: String,
pub steps: Vec<PlanStep>,
}Expand description
An ordered, harness-owned task plan: a top-level goal decomposed into steps.
Fields§
§goal: StringThe overall task this plan accomplishes (re-surfaced each turn to fight goal-drift / “lost in the middle” on long runs).
steps: Vec<PlanStep>Ordered subgoals.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn new(
goal: impl Into<String>,
steps: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( goal: impl Into<String>, steps: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Build a plan from a goal and an ordered list of step descriptions.
Sourcepub fn current(&self) -> Option<usize>
pub fn current(&self) -> Option<usize>
Index of the first non-terminal (Pending/Active) step — the one the
executor should be working on. None when every step is Done/Failed.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether every step reached a terminal status (Done or Failed).
Sourcepub fn all_done(&self) -> bool
pub fn all_done(&self) -> bool
Whether all steps are specifically Done (the success condition).
Sourcepub fn set_status(&mut self, idx: usize, status: StepStatus) -> bool
pub fn set_status(&mut self, idx: usize, status: StepStatus) -> bool
Mark the step at idx, returning false if idx is out of range (no
panic — library code must not index blindly).
Trait Implementations§
impl Eq for Plan
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.