pub trait Middleware {
// Required method
fn name(&self) -> &str;
// Provided methods
fn pre(&self, tool: &str, args: Value) -> Value { ... }
fn post(&self, tool: &str, result: Value) -> Value { ... }
}Expand description
A middleware that can modify args before a call and result after.
Required Methods§
Provided Methods§
fn pre(&self, tool: &str, args: Value) -> Value
fn post(&self, tool: &str, result: Value) -> Value
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".