pub trait TurnStep<P, T>: Send + Sync{
// Required method
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut TurnCtx<'life2, P, T>,
) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
One cohesive slice of turn behavior the turn loop drives.
Each step reads and mutates the turn’s working state through TurnCtx and
reports a StepOutcome. Generic over the provider P and tool executor
T so a step can dial the provider and use the turn’s error type directly.
Required Methods§
Sourcefn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut TurnCtx<'life2, P, T>,
) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut TurnCtx<'life2, P, T>,
) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run this step against the turn context.
§Errors
Returns the provider’s error type when the step fails in a way that
should abort the turn. A step that is best-effort swallows its own
provider failures and returns StepOutcome::Continue instead.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".