pub trait WithMiddleware {
// Required methods
fn middleware(self, middleware: impl Into<Middleware>) -> Self;
fn middlewares<I>(self, middlewares: Vec<I>) -> Self
where I: Into<Middleware>;
}Expand description
Extension methods for applying middleware to routes and routers
Required Methods§
Sourcefn middleware(self, middleware: impl Into<Middleware>) -> Self
fn middleware(self, middleware: impl Into<Middleware>) -> Self
Apply a single middleware
Sourcefn middlewares<I>(self, middlewares: Vec<I>) -> Selfwhere
I: Into<Middleware>,
fn middlewares<I>(self, middlewares: Vec<I>) -> Selfwhere
I: Into<Middleware>,
Apply multiple middleware
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.