Skip to main content

ExecuteProvider

Trait ExecuteProvider 

Source
pub trait ExecuteProvider<Ctx: Send + Sync>: Send + Sync {
    // Required method
    fn execute<'life0, 'async_trait>(
        ctx: &'life0 Ctx,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
       where 'life0: 'async_trait;

    // Provided method
    fn execute_dual<'life0, 'async_trait>(
        ctx: &'life0 Ctx,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Provider trait for tool execution (the core “handle” operation).

Separates execution logic from metadata, approval, and output mapping so the same executor can be projected through both Tool and ToolHandler facades without bidirectional adapters.

Required Methods§

Source

fn execute<'life0, 'async_trait>( ctx: &'life0 Ctx, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where 'life0: 'async_trait,

Execute a tool with JSON arguments and return JSON output.

Provided Methods§

Source

fn execute_dual<'life0, 'async_trait>( ctx: &'life0 Ctx, args: Value, ) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute with dual-channel output (LLM summary + UI content).

Default delegates to execute() for backward compatibility.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§