fn check_in(&self, mut conn: Connection) {
        self.emit_event(|handler| {
            handler.handle_connection_checked_in_event(conn.checked_in_event());
        });

        conn.mark_checked_in();

        // Close the connection if it's stale.
        if conn.is_stale(self.generation.load(Ordering::SeqCst)) {
            self.close_connection(conn, ConnectionClosedReason::Stale);

            return;
        }

        self.connections.write().unwrap().push(conn);
        self.wait_queue.notify_ready();
    }
/// Checks a connection back into the pool and notifies the wait queue that a connection is
/// ready. If the connection is stale, it will be closed instead of being added to the set of
/// available connections. The time that the connection is checked in will be marked to
/// facilitate detecting if the connection becomes idle.
Checks a connection back into the pool and notifies the wait queue that a connection is
ready. If the connection is stale, it will be closed instead of being added to the set of
available connections. The time that the connection is checked in will be marked to
facilitate detecting if the connection becomes idle.
Checks a connection back into the pool and notifies the wait queue that a connection is ready . If the connection is stale it will be closed instead of being added to the set of available connections . The time that the connection is checked in will be marked to facilitate detecting if the connection becomes idle .
fn check_in(&self, mut conn: Connection) {
        self.emit_event(|handler| {
            handler.handle_connection_checked_in_event(conn.checked_in_event());
        });
        conn.mark_checked_in();
        // Close the connection if it's stale.
        if conn.is_stale(self.generation.load(Ordering::SeqCst)) {
            self.close_connection(conn, ConnectionClosedReason::Stale);
            return;
        }
        self.connections.write().unwrap().push(conn);
        self.wait_queue.notify_ready();
    }
fn check_in ( & self , mut conn : Connection ) { self . emit_event ( | handler | { handler . handle_connection_checked_in_event ( conn . checked_in_event ( ) ) ; } ) ; conn . mark_checked_in ( ) ; // Close the connection if it's stale. if conn . is_stale ( self . generation . load ( Ordering :: SeqCst ) ) { self . close_connection ( conn , ConnectionClosedReason :: Stale ) ; return ; } self . connections . write ( ) . unwrap ( ) . push ( conn ) ; self . wait_queue . notify_ready ( ) ; }
Checks a connection back into the pool and notifies the wait queue that a connection is
ready.
Checks a connection back into the pool and notifies the wait queue that a connection is ready .
&self
conn
Connection
&self
conn
Connection