Skip to main content

TurnToolExecutor

Trait TurnToolExecutor 

Source
pub trait TurnToolExecutor: Send + Sync {
    // Required method
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        call: ToolCallCompleted,
    ) -> Pin<Box<dyn Future<Output = Result<TurnToolOutcome>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn register_provider_cleanup(&self, _cleanup: Arc<dyn ProviderTurnCleanup>) { ... }
}
Expand description

Executes a single tool call through the runtime’s registry + policy. Implemented by the runtime; used by providers that run their own in-stream agent loop.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, call: ToolCallCompleted, ) -> Pin<Box<dyn Future<Output = Result<TurnToolOutcome>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn register_provider_cleanup(&self, _cleanup: Arc<dyn ProviderTurnCleanup>)

Registers provider-owned cleanup for the current turn. Most providers do not own a local child process and therefore never call this. The runtime uses a registered handle only after interrupting the turn, when it can distinguish its own task ending from provider cleanup being acknowledged.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§