pub struct ExecutionPlan {
pub goal: String,
pub steps: Vec<Task>,
pub complexity: Complexity,
pub required_tools: Vec<String>,
pub estimated_steps: usize,
}Expand description
Execution plan for a task
Fields§
§goal: StringHigh-level goal
steps: Vec<Task>Decomposed steps
complexity: ComplexityEstimated complexity
required_tools: Vec<String>Required tools
estimated_steps: usizeEstimated total steps
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
pub fn new(goal: impl Into<String>, complexity: Complexity) -> Self
pub fn add_step(&mut self, step: Task)
Sourcepub fn upsert_step(&mut self, step: Task)
pub fn upsert_step(&mut self, step: Task)
Insert or update one step while preserving the plan’s insertion order.
Flow replay can deliver the same durable step definition more than once (for example when an observer is attached during a resumed run). Keeping this operation on the canonical plan prevents each adapter from implementing a subtly different deduplication and status policy.
pub fn add_required_tool(&mut self, tool: impl Into<String>)
Sourcepub fn definition_identity(
&self,
) -> Result<ExecutionIdentityV1, ExecutionIdentityError>
pub fn definition_identity( &self, ) -> Result<ExecutionIdentityV1, ExecutionIdentityError>
Derive an identity for the immutable plan definition.
Mutable status is deliberately excluded: restarting or retrying a Flow must keep the same plan identity while its progress changes. The identity contains only already-materialized task definitions and exposes no task output or other runtime evidence. Dynamic Flow adapters bound user-facing descriptions before they enter this projection.
Sourcepub fn get_ready_steps(&self) -> Vec<&Task>
pub fn get_ready_steps(&self) -> Vec<&Task>
Get steps that are ready to execute (dependencies met)
Sourcepub fn mark_status(&mut self, step_id: &str, status: TaskStatus)
pub fn mark_status(&mut self, step_id: &str, status: TaskStatus)
Update the status of a step by ID
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Count remaining Pending steps
Sourcepub fn has_deadlock(&self) -> bool
pub fn has_deadlock(&self) -> bool
Detect deadlock: Pending steps remain but none are ready to execute.
This happens when all Pending steps have dependencies that are not Completed (e.g., circular deps or all deps Failed/Skipped).
Trait Implementations§
Source§impl Clone for ExecutionPlan
impl Clone for ExecutionPlan
Source§fn clone(&self) -> ExecutionPlan
fn clone(&self) -> ExecutionPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecutionPlan
impl Debug for ExecutionPlan
Source§impl<'de> Deserialize<'de> for ExecutionPlan
impl<'de> Deserialize<'de> for ExecutionPlan
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>,
Auto Trait Implementations§
impl Freeze for ExecutionPlan
impl RefUnwindSafe for ExecutionPlan
impl Send for ExecutionPlan
impl Sync for ExecutionPlan
impl Unpin for ExecutionPlan
impl UnsafeUnpin for ExecutionPlan
impl UnwindSafe for ExecutionPlan
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more