pub trait Action: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn description(&self) -> &str;
fn run<'life0, 'async_trait>(
&'life0 self,
input: ActionInput,
ctx: ActionContext,
) -> Pin<Box<dyn Future<Output = ActionResult> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn metadata(&self) -> ActionMeta { ... }
}Expand description
Action trait - the core abstraction for atomic execution units
Actions are black boxes to the Executor. They can:
- Perform side effects
- Return typed outputs
- Request user clarification
- Fail with retry semantics
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the action description (for LLM planning)
Sourcefn run<'life0, 'async_trait>(
&'life0 self,
input: ActionInput,
ctx: ActionContext,
) -> Pin<Box<dyn Future<Output = ActionResult> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
input: ActionInput,
ctx: ActionContext,
) -> Pin<Box<dyn Future<Output = ActionResult> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Execute the action
Provided Methods§
Sourcefn metadata(&self) -> ActionMeta
fn metadata(&self) -> ActionMeta
Get action metadata (typed input/output schema hints for planning/runtime checks)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".