Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn on_result(
        &self,
        tool_id: &str,
        tool_def: &ToolDefinition,
        result: &mut Value,
    );
}
Expand description

A result-rewriting hook. Must be deterministic and side-effect-free beyond the result mutation + any internal audit sinks the impl owns.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn on_result( &self, tool_id: &str, tool_def: &ToolDefinition, result: &mut Value, )

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§