pub fn wrap<M>(
        self,
        mw: M,
    ) -> Scope<
        impl ServiceFactory<
            ServiceRequest,
            Config = (),
            Response = ServiceResponse,
            Error = Error,
            InitError = (),
        >,
    >
    where
        M: Transform<
            T::Service,
            ServiceRequest,
            Response = ServiceResponse,
            Error = Error,
            InitError = (),
        >,
    {
        Scope {
            endpoint: apply(mw, self.endpoint),
            rdef: self.rdef,
            app_data: self.app_data,
            guards: self.guards,
            services: self.services,
            default: self.default,
            external: self.external,
            factory_ref: self.factory_ref,
        }
    }
/// Registers middleware, in the form of a middleware component (type),
/// that runs during inbound processing in the request
/// life-cycle (request -> response), modifying request as
/// necessary, across all requests managed by the *Scope*.  Scope-level
/// middleware is more limited in what it can modify, relative to Route or
/// Application level middleware, in that Scope-level middleware can not modify
/// ServiceResponse.
///
/// Use middleware when you need to read or modify *every* request in some way.
Registers middleware, in the form of a middleware component (type),
that runs during inbound processing in the request
life-cycle (request -> response), modifying request as
necessary, across all requests managed by the *Scope*.  Scope-level
middleware is more limited in what it can modify, relative to Route or
Application level middleware, in that Scope-level middleware can not modify
ServiceResponse.

Use middleware when you need to read or modify *every* request in some way.
Registers middleware in the form of a middleware component ( type ) that runs during inbound processing in the request life - cycle ( request - > response ) modifying request as necessary across all requests managed by the * Scope * . Scope - level middleware is more limited in what it can modify relative to Route or Application level middleware in that Scope - level middleware can not modify ServiceResponse . Use middleware when you need to read or modify * every * request in some way .
pub fn wrap<M>(
        self,
        mw: M,
    ) -> Scope<
        impl ServiceFactory<
            ServiceRequest,
            Config = (),
            Response = ServiceResponse,
            Error = Error,
            InitError = (),
        >,
    >
    where
        M: Transform<
            T::Service,
            ServiceRequest,
            Response = ServiceResponse,
            Error = Error,
            InitError = (),
        >,
    {
        Scope {
            endpoint: apply(mw, self.endpoint),
            rdef: self.rdef,
            app_data: self.app_data,
            guards: self.guards,
            services: self.services,
            default: self.default,
            external: self.external,
            factory_ref: self.factory_ref,
        }
    }
pub fn wrap < M > ( self , mw : M , ) -> Scope < impl ServiceFactory < ServiceRequest , Config = ( ) , Response = ServiceResponse , Error = Error , InitError = ( ) , > , > where M : Transform < T :: Service , ServiceRequest , Response = ServiceResponse , Error = Error , InitError = ( ) , > , { Scope { endpoint : apply ( mw , self . endpoint ) , rdef : self . rdef , app_data : self . app_data , guards : self . guards , services : self . services , default : self . default , external : self . external , factory_ref : self . factory_ref , } }
Registers middleware, in the form of a middleware component (type),
that runs during inbound processing in the request
life-cycle (request -> response), modifying request as
necessary, across all requests managed by the *Scope*.
Registers middleware in the form of a middleware component ( type ) that runs during inbound processing in the request life - cycle ( request - > response ) modifying request as necessary across all requests managed by the * Scope * .
self
mw
M
self
mw
M