Skip to main content

PrefetchDispatcher

Trait PrefetchDispatcher 

Source
pub trait PrefetchDispatcher: Send + Sync {
    // Required method
    fn dispatch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<String, PrefetchError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Abstracts how a prefetch is actually executed. The real impl wraps the MCP server’s tools/call handler; the test impl returns a canned body or an error after an optional sleep.

Required Methods§

Source

fn dispatch<'life0, 'life1, 'async_trait>( &'life0 self, tool_name: &'life1 str, args: Value, ) -> Pin<Box<dyn Future<Output = Result<String, PrefetchError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute tool_name with args out-of-band and return the response body (the same string the LLM would receive). Errors are logged at WARN by the engine and counted as wasted, never surfaced to the LLM stream.

Implementors§