pub enum PlanStep {
ApiCall {
result_var: String,
method: String,
path: PathTemplate,
body: Option<ValueExpr>,
},
Assign {
var: String,
expr: ValueExpr,
},
Conditional {
condition: ValueExpr,
then_steps: Vec<PlanStep>,
else_steps: Vec<PlanStep>,
},
BoundedLoop {
item_var: String,
collection: ValueExpr,
max_iterations: usize,
body: Vec<PlanStep>,
},
Return {
value: ValueExpr,
},
TryCatch {
try_steps: Vec<PlanStep>,
catch_var: Option<String>,
catch_steps: Vec<PlanStep>,
finally_steps: Vec<PlanStep>,
},
ParallelApiCalls {
result_var: String,
calls: Vec<(String, String, PathTemplate, Option<ValueExpr>)>,
},
Continue,
Break,
McpCall {
result_var: String,
server_id: String,
tool_name: String,
args: Option<ValueExpr>,
},
SdkCall {
result_var: String,
operation: String,
args: Option<ValueExpr>,
},
}Expand description
A single step in the execution plan.
Variants§
ApiCall
API call: const result = await api.get('/path')
Assign
Variable assignment: const x = expr
Conditional
Conditional: if (cond) { ... } else { ... }
BoundedLoop
Bounded loop: for (const x of arr.slice(0, N)) { ... }
Return
Return statement
TryCatch
Try/catch statement: try { ... } catch (e) { ... }
Fields
ParallelApiCalls
Parallel API calls: const [a, b] = await Promise.all([api.get(...), api.get(...)])
Continue
Continue statement: skip to next loop iteration
Break
Break statement: exit the current loop
McpCall
MCP tool call: const result = await mcp.call('server', 'tool', { ... })
SdkCall
SDK call: const result = await api.getCostAndUsage({ start_date: '...' })
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanStep
impl RefUnwindSafe for PlanStep
impl Send for PlanStep
impl Sync for PlanStep
impl Unpin for PlanStep
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.