Skip to main content

Interceptor

Trait Interceptor 

Source
pub trait Interceptor:
    Send
    + Sync
    + 'static {
    // Required method
    fn around(
        &'static self,
        ctx: RequestContext,
        next: NextHandler,
    ) -> BoxFuture<'static, Response>;
}
Expand description

One layer of the aspect chain.

around must call next.run(ctx) (typically once) to invoke the inner layer. Returning a response without calling next short-circuits the chain — useful for caches and rate limits.

Required Methods§

Source

fn around( &'static self, ctx: RequestContext, next: NextHandler, ) -> BoxFuture<'static, Response>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§