macro_rules! with_middlewares {
($self:ident, $handler:path) => { ... };
($self:ident, $handler:path, $($extra:expr),+ $(,)?) => { ... };
}Expand description
A helper macro to wrap an async handler method into a RequestHandler
and compose it with middlewares.
§Example
ⓘ
let handle = with_middlewares!(self, Self::internal_handle_sse_message);
handle
// OR
let handler = with_middlewares!(self, Self::internal_handle_sse_message, extra_middlewares1, extra_middlewares2);