|
1 | 1 | use crate::connection::{ConnectOptions, Connection};
|
2 | 2 | use crate::database::Database;
|
3 |
| -use crate::pool::connection::{Floating, Live}; |
| 3 | +use crate::pool::connection::Floating; |
4 | 4 | use crate::pool::inner::PoolInner;
|
5 | 5 | use crate::pool::PoolConnection;
|
6 | 6 | use crate::rt::JoinHandle;
|
7 | 7 | use crate::Error;
|
8 | 8 | use ease_off::EaseOff;
|
9 |
| -use event_listener::{Event, EventListener}; |
| 9 | +use event_listener::Event; |
10 | 10 | use std::fmt::{Display, Formatter};
|
11 | 11 | use std::future::Future;
|
12 |
| -use std::pin::Pin; |
13 | 12 | use std::ptr;
|
14 | 13 | use std::sync::atomic::{AtomicUsize, Ordering};
|
15 |
| -use std::sync::{Arc, RwLock}; |
16 |
| -use std::task::{Context, Poll}; |
17 |
| -use std::time::{Duration, Instant}; |
18 |
| -use tracing::Instrument; |
| 14 | +use std::sync::Arc; |
| 15 | +use std::time::Instant; |
19 | 16 |
|
20 | 17 | use std::io;
|
21 | 18 |
|
@@ -74,7 +71,7 @@ use std::io;
|
74 | 71 | /// `set_connect_options` and `get_connect_options` were removed in 0.9.0 because they complicated
|
75 | 72 | /// the pool internals. They can be reimplemented by capturing a mutex, or similar, in the callback.
|
76 | 73 | ///
|
77 |
| -/// This example uses Postgres and [`tokio::sync::Mutex`] but may be adapted to any driver |
| 74 | +/// This example uses Postgres and [`tokio::sync::RwLock`] but may be adapted to any driver |
78 | 75 | /// or `async-std`, respectively.
|
79 | 76 | ///
|
80 | 77 | /// ```rust,no_run
|
@@ -197,11 +194,11 @@ pub trait PoolConnector<DB: Database>: Send + Sync + 'static {
|
197 | 194 | ///
|
198 | 195 | /// * [`io::ErrorKind::ConnectionRefused`]
|
199 | 196 | /// * Database errors for which
|
200 |
| - /// [`is_retryable_connect_error`][crate::error::DatabaseError::is_retryable_connect_error] |
201 |
| - /// returns `true`. |
| 197 | + /// [`is_retryable_connect_error`][crate::error::DatabaseError::is_retryable_connect_error] |
| 198 | + /// returns `true`. |
202 | 199 | /// * [`Error::PoolConnector`] with `retryable: true`.
|
203 |
| - /// This error kind is not returned internally and is designed to allow this method to return |
204 |
| - /// arbitrary error types not otherwise supported. |
| 200 | + /// This error kind is not returned internally and is designed to allow this method to return |
| 201 | + /// arbitrary error types not otherwise supported. |
205 | 202 | ///
|
206 | 203 | /// Manual implementations of this method may also use the signature:
|
207 | 204 | /// ```rust,ignore
|
@@ -363,7 +360,7 @@ impl ConnectionCounter {
|
363 | 360 | // Check that `self` can increase size first before we check the parent.
|
364 | 361 | let acquired = self.acquire_permit_self(pool).await;
|
365 | 362 |
|
366 |
| - if let Some(parent) = &pool.options.parent_pool { |
| 363 | + if let Some(parent) = pool.parent() { |
367 | 364 | let (_, permit) = parent.0.counter.acquire_permit_self(&parent.0).await;
|
368 | 365 |
|
369 | 366 | // consume the parent permit
|
|
0 commit comments