pub fn on_connect<CB>(self, f: CB) -> HttpServer<F, I, S, B>
    where
        CB: Fn(&dyn Any, &mut Extensions) + Send + Sync + 'static,
    {
        HttpServer {
            factory: self.factory,
            config: self.config,
            backlog: self.backlog,
            sockets: self.sockets,
            builder: self.builder,
            on_connect_fn: Some(Arc::new(f)),
            _phantom: PhantomData,
        }
    }
/// Sets function that will be called once before each connection is handled.
/// It will receive a `&std::any::Any`, which contains underlying connection type and an
/// [Extensions] container so that request-local data can be passed to middleware and handlers.
///
/// For example:
/// - `actix_tls::openssl::SslStream<actix_web::rt::net::TcpStream>` when using openssl.
/// - `actix_tls::rustls::TlsStream<actix_web::rt::net::TcpStream>` when using rustls.
/// - `actix_web::rt::net::TcpStream` when no encryption is used.
///
/// See `on_connect` example for additional details.
Sets function that will be called once before each connection is handled.
It will receive a `&std::any::Any`, which contains underlying connection type and an
[Extensions] container so that request-local data can be passed to middleware and handlers.



See `on_connect` example for additional details.
Sets function that will be called once before each connection is handled . It will receive a ` &std :: any :: Any ` which contains underlying connection type and an [ Extensions ] container so that request - local data can be passed to middleware and handlers . See ` on_connect ` example for additional details .
pub fn on_connect<CB>(self, f: CB) -> HttpServer<F, I, S, B>
    where
        CB: Fn(&dyn Any, &mut Extensions) + Send + Sync + 'static,
    {
        HttpServer {
            factory: self.factory,
            config: self.config,
            backlog: self.backlog,
            sockets: self.sockets,
            builder: self.builder,
            on_connect_fn: Some(Arc::new(f)),
            _phantom: PhantomData,
        }
    }
pub fn on_connect < CB > ( self , f : CB ) -> HttpServer < F , I , S , B > where CB : Fn ( & dyn Any , & mut Extensions ) + Send + Sync + ' static , { HttpServer { factory : self . factory , config : self . config , backlog : self . backlog , sockets : self . sockets , builder : self . builder , on_connect_fn : Some ( Arc :: new ( f ) ) , _phantom : PhantomData , } }
Sets function that will be called once before each connection is handled.
Sets function that will be called once before each connection is handled .
self
f
CB
self
f
CB