Skip to main content

Next

Trait Next 

Source
pub trait Next: Send + Sync {
    // Required method
    fn call(self, request: Request) -> impl Future<Output = Response> + Send;
}
Expand description

The continuation passed to a MiddlewareService: runs the rest of the chain (the next middleware, or the route handler).

Call call to forward the (possibly modified) request inward and obtain the response. Not calling it short-circuits the chain: your response is returned without running any inner middleware or the handler.

Required Methods§

Source

fn call(self, request: Request) -> impl Future<Output = Response> + Send

Forwards request to the rest of the chain and returns its response.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§