Struct saphir::middleware::Builder
source · pub struct Builder<Chain: MiddlewareChain> { /* private fields */ }
Expand description
Builder to apply middleware onto the http stack
Implementations§
source§impl<Chain: MiddlewareChain + 'static> Builder<Chain>
impl<Chain: MiddlewareChain + 'static> Builder<Chain>
sourcepub fn apply<'a, Mid, E>(
self,
mid: Mid,
include_path: Vec<&str>,
exclude_path: E
) -> Builder<MiddlewareChainLink<Mid, Chain>>where
Mid: 'static + Middleware + Sync + Send,
E: Into<Option<Vec<&'a str>>>,
pub fn apply<'a, Mid, E>( self, mid: Mid, include_path: Vec<&str>, exclude_path: E ) -> Builder<MiddlewareChainLink<Mid, Chain>>where Mid: 'static + Middleware + Sync + Send, E: Into<Option<Vec<&'a str>>>,
Method to apply a new middleware onto the stack where the include_path
vec are all path affected by the middleware, and exclude_path
are
exclusion amongst the included paths.
use saphir::middleware::Builder as MBuilder;
let builder = MBuilder::default().apply(log_middleware, vec!["/"], None);