async fn wait_for_conn(&self, deadline: Instant) -> Result<(), Error> {
        if self.is_closed() {
            return Err(Error::PoolClosed);
        }

        let mut waker_pushed = false;

        timeout(
            deadline_as_timeout::<DB>(deadline)?,
            // `poll_fn` gets us easy access to a `Waker` that we can push to our queue
            future::poll_fn(|ctx| -> Poll<()> {
                if !waker_pushed {
                    // only push the waker once
                    self.waiters.push(ctx.waker().to_owned());
                    waker_pushed = true;
                    Poll::Pending
                } else {
                    Poll::Ready(())
                }
            }),
        )
        .await
        .map_err(|_| Error::PoolTimedOut)
    }
/// Wait for a connection, if either `size` drops below `max_connections` so we can
/// open a new connection, or if an idle connection is returned to the pool.
///
/// Returns an error if `deadline` elapses before we are woken.
Wait for a connection, if either `size` drops below `max_connections` so we can
open a new connection, or if an idle connection is returned to the pool.

Returns an error if `deadline` elapses before we are woken.
Wait for a connection if either ` size ` drops below ` max_connections ` so we can open a new connection or if an idle connection is returned to the pool . Returns an error if ` deadline ` elapses before we are woken .
async fn wait_for_conn(&self, deadline: Instant) -> Result<(), Error> {
        if self.is_closed() {
            return Err(Error::PoolClosed);
        }
        let mut waker_pushed = false;
        timeout(
            deadline_as_timeout::<DB>(deadline)?,
            // `poll_fn` gets us easy access to a `Waker` that we can push to our queue
            future::poll_fn(|ctx| -> Poll<()> {
                if !waker_pushed {
                    // only push the waker once
                    self.waiters.push(ctx.waker().to_owned());
                    waker_pushed = true;
                    Poll::Pending
                } else {
                    Poll::Ready(())
                }
            }),
        )
        .await
        .map_err(|_| Error::PoolTimedOut)
    }
async fn wait_for_conn ( & self , deadline : Instant ) -> Result < ( ) , Error > { if self . is_closed ( ) { return Err ( Error :: PoolClosed ) ; } let mut waker_pushed = false ; timeout ( deadline_as_timeout :: < DB > ( deadline ) ? , // `poll_fn` gets us easy access to a `Waker` that we can push to our queue future :: poll_fn ( | ctx | -> Poll < ( ) > { if ! waker_pushed { // only push the waker once self . waiters . push ( ctx . waker ( ) . to_owned ( ) ) ; waker_pushed = true ; Poll :: Pending } else { Poll :: Ready ( ( ) ) } } ) , ) . await . map_err ( | _ | Error :: PoolTimedOut ) }
Wait for a connection, if either `size` drops below `max_connections` so we can
open a new connection, or if an idle connection is returned to the pool.
Wait for a connection if either ` size ` drops below ` max_connections ` so we can open a new connection or if an idle connection is returned to the pool .
&self
deadline
Instant
&self
deadline
Instant