pub fn listen<F, N: AsRef<str>>(
        mut self,
        name: N,
        lst: net::TcpListener,
        factory: F,
    ) -> io::Result<Self>
    where
        F: ServiceFactory<TcpStream>,
    {
        let token = self.token.next();
        self.services.push(StreamNewService::create(
            name.as_ref().to_string(),
            token,
            factory,
            lst.local_addr()?,
        ));
        self.sockets
            .push((token, name.as_ref().to_string(), StdListener::Tcp(lst)));
        Ok(self)
    }
/// Add new service to the server.
Add new service to the server.
Add new service to the server .
pub fn listen<F, N: AsRef<str>>(
        mut self,
        name: N,
        lst: net::TcpListener,
        factory: F,
    ) -> io::Result<Self>
    where
        F: ServiceFactory<TcpStream>,
    {
        let token = self.token.next();
        self.services.push(StreamNewService::create(
            name.as_ref().to_string(),
            token,
            factory,
            lst.local_addr()?,
        ));
        self.sockets
            .push((token, name.as_ref().to_string(), StdListener::Tcp(lst)));
        Ok(self)
    }
pub fn listen < F , N : AsRef < str > > ( mut self , name : N , lst : net :: TcpListener , factory : F , ) -> io :: Result < Self > where F : ServiceFactory < TcpStream > , { let token = self . token . next ( ) ; self . services . push ( StreamNewService :: create ( name . as_ref ( ) . to_string ( ) , token , factory , lst . local_addr ( ) ? , ) ) ; self . sockets . push ( ( token , name . as_ref ( ) . to_string ( ) , StdListener :: Tcp ( lst ) ) ) ; Ok ( self ) }
Add new service to the server.
Add new service to the server .
mut self
name
N
lst
net::TcpListener
factory
F
mut self
name
N
lst
net::TcpListener
factory
F