pub trait AsyncMiddleware: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute<'a, 'async_trait>(
&'a self,
request: ToolRequest,
next: Box<dyn Fn(ToolRequest) -> Pin<Box<dyn Future<Output = ToolResult> + Send>> + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
}Expand description
Async middleware trait
Required Methods§
Sourcefn execute<'a, 'async_trait>(
&'a self,
request: ToolRequest,
next: Box<dyn Fn(ToolRequest) -> Pin<Box<dyn Future<Output = ToolResult> + Send>> + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn execute<'a, 'async_trait>(
&'a self,
request: ToolRequest,
next: Box<dyn Fn(ToolRequest) -> Pin<Box<dyn Future<Output = ToolResult> + Send>> + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Execute middleware
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".