Skip to main content

Middleware

Trait Middleware 

Source
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§

Source

fn name(&self) -> &str

Provided Methods§

Source

fn pre(&self, tool: &str, args: Value) -> Value

Source

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".

Implementors§