async fn connect(&self) -> Result<Self::Connection, Self::Error> {
        info!(
            "Creating a new connection to {:?} using user {:?}",
            self.address.name(),
            self.user.name
        );

        // Put a temporary process_id into the stats
        // for server login.
        let process_id = rand::random::<i32>();
        self.stats.server_login(process_id, self.address.id);

        // Connect to the PostgreSQL server.
        match Server::startup(
            &self.address,
            &self.user,
            &self.database,
            self.client_server_map.clone(),
            self.stats.clone(),
        )
        .await
        {
            Ok(conn) => {
                // Remove the temporary process_id from the stats.
                self.stats.server_disconnecting(process_id, self.address.id);
                Ok(conn)
            }
            Err(err) => {
                // Remove the temporary process_id from the stats.
                self.stats.server_disconnecting(process_id, self.address.id);
                Err(err)
            }
        }
    }
/// Attempts to create a new connection.
Attempts to create a new connection.
Attempts to create a new connection .
async fn connect(&self) -> Result<Self::Connection, Self::Error> {
        info!(
            "Creating a new connection to {:?} using user {:?}",
            self.address.name(),
            self.user.name
        );
        // Put a temporary process_id into the stats
        // for server login.
        let process_id = rand::random::<i32>();
        self.stats.server_login(process_id, self.address.id);
        // Connect to the PostgreSQL server.
        match Server::startup(
            &self.address,
            &self.user,
            &self.database,
            self.client_server_map.clone(),
            self.stats.clone(),
        )
        .await
        {
            Ok(conn) => {
                // Remove the temporary process_id from the stats.
                self.stats.server_disconnecting(process_id, self.address.id);
                Ok(conn)
            }
            Err(err) => {
                // Remove the temporary process_id from the stats.
                self.stats.server_disconnecting(process_id, self.address.id);
                Err(err)
            }
        }
    }
async fn connect ( & self ) -> Result < Self :: Connection , Self :: Error > { info ! ( " " self address name ( ) self user name ) ; // Put a temporary process_id into the stats // for server login. let process_id = rand :: random :: < i32 > ( ) ; self . stats . server_login ( process_id , self . address . id ) ; // Connect to the PostgreSQL server. match Server :: startup ( & self . address , & self . user , & self . database , self . client_server_map . clone ( ) , self . stats . clone ( ) , ) . await { Ok ( conn ) => { // Remove the temporary process_id from the stats. self . stats . server_disconnecting ( process_id , self . address . id ) ; Ok ( conn ) } Err ( err ) => { // Remove the temporary process_id from the stats. self . stats . server_disconnecting ( process_id , self . address . id ) ; Err ( err ) } } }
Attempts to create a new connection.
Attempts to create a new connection .
&self
&self