pub trait ActionExecutor: Send + Sync {
// Required methods
fn parse(&self, turn: &LlmTurnResult) -> Result<ParseOutcome, ParseError>;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 mut self,
actions: Vec<Action>,
ctx: &'life1 ExecCtx,
) -> Pin<Box<dyn Future<Output = Result<Observation, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
The seam: one turn’s output in, one observation out.
Required Methods§
Sourcefn parse(&self, turn: &LlmTurnResult) -> Result<ParseOutcome, ParseError>
fn parse(&self, turn: &LlmTurnResult) -> Result<ParseOutcome, ParseError>
Turn output → this backend’s action format. Truncation salvage (structural verdict + text-channel harvest) is a parse-end move; stream aggregation stays in the provider layer. CodeAct implementations must validate the full batch before executing anything (D2).
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 mut self,
actions: Vec<Action>,
ctx: &'life1 ExecCtx,
) -> Pin<Box<dyn Future<Output = Result<Observation, ExecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 mut self,
actions: Vec<Action>,
ctx: &'life1 ExecCtx,
) -> Pin<Box<dyn Future<Output = Result<Observation, ExecError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute a batch and return the observation. Never dropped because the
environment died (D15): if anything ran, it’s Ok(Observation) with
batch_status set; Err(ExecError) only when nothing ran.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".