Skip to main content

NativeAsyncExecutor

Trait NativeAsyncExecutor 

Source
pub trait NativeAsyncExecutor:
    Send
    + Sync
    + 'static {
    // Required methods
    fn authorize<'life0, 'life1, 'async_trait>(
        &'life0 self,
        call: &'life1 NativeToolCall,
    ) -> Pin<Box<dyn Future<Output = Result<NativeCallPolicy>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        call: NativeToolCall,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Hosts must use their ordinary tool authorization, argument validation, pre/post execution hooks, resource scoping and outbound limits here. Native metadata from the provider never grants permission to execute a tool.

Required Methods§

Source

fn authorize<'life0, 'life1, 'async_trait>( &'life0 self, call: &'life1 NativeToolCall, ) -> Pin<Box<dyn Future<Output = Result<NativeCallPolicy>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§