pub enum ActionNode {
Action {
tool: String,
params: HashMap<String, ParamExpr>,
},
Sequence(Vec<ActionNode>),
If {
condition: ConditionExpr,
then: Box<ActionNode>,
else_: Option<Box<ActionNode>>,
},
ForEach {
variable: String,
collection: CollectionExpr,
body: Box<ActionNode>,
},
StoreResult {
key: String,
action: Box<ActionNode>,
},
}Expand description
A node in the action AST
Variants§
Action
Execute a single tool/action
Sequence(Vec<ActionNode>)
Execute a sequence of actions in order
If
Conditional execution
ForEach
Iterate over a collection
StoreResult
Store result of an action for later use
Implementations§
Source§impl ActionNode
impl ActionNode
Sourcepub fn action_count(&self) -> usize
pub fn action_count(&self) -> usize
Count the number of leaf actions in this AST
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
Get all tool names referenced in this AST
Trait Implementations§
Source§impl Clone for ActionNode
impl Clone for ActionNode
Source§fn clone(&self) -> ActionNode
fn clone(&self) -> ActionNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActionNode
impl Debug for ActionNode
Source§impl<'de> Deserialize<'de> for ActionNode
impl<'de> Deserialize<'de> for ActionNode
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 ActionNode
impl RefUnwindSafe for ActionNode
impl Send for ActionNode
impl Sync for ActionNode
impl Unpin for ActionNode
impl UnsafeUnpin for ActionNode
impl UnwindSafe for ActionNode
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