pub trait Middleware<C>:
Send
+ Sync
+ 'static {
// Required method
fn run(&self, ctx: C) -> BoxFuture<'static, Result<C, CrawlError>>;
}Expand description
Transforms a request context before its matched handler runs.
Required Methods§
Sourcefn run(&self, ctx: C) -> BoxFuture<'static, Result<C, CrawlError>>
fn run(&self, ctx: C) -> BoxFuture<'static, Result<C, CrawlError>>
Runs before the matched handler; receives the context by value and returns it (possibly mutated). An error short-circuits the request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".