pub trait Pool: Sync + Send + Debug {
// Required methods
fn new(manager: ConnManager) -> Result<Self, Error>
where Self: Sized;
fn get<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_timeout<'life0, 'async_trait>(
&'life0 self,
d: Duration
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_max_idle_conns<'life0, 'async_trait>(
&'life0 self,
n: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_max_open_conns<'life0, 'async_trait>(
&'life0 self,
n: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn driver_type(&self) -> &str;
// Provided methods
fn set_timeout<'life0, 'async_trait>(
&'life0 self,
_timeout: Option<Duration>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_conn_max_lifetime<'life0, 'async_trait>(
&'life0 self,
_max_lifetime: Option<Duration>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Value> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Required Methods§
sourcefn new(manager: ConnManager) -> Result<Self, Error>where
Self: Sized,
fn new(manager: ConnManager) -> Result<Self, Error>where
Self: Sized,
create an Pool,use ConnManager
sourcefn get<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get an connection from pool
sourcefn get_timeout<'life0, 'async_trait>(
&'life0 self,
d: Duration
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_timeout<'life0, 'async_trait>(
&'life0 self,
d: Duration
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get timeout from pool
fn set_max_idle_conns<'life0, 'async_trait>(
&'life0 self,
n: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_max_open_conns<'life0, 'async_trait>(
&'life0 self,
n: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
sourcefn driver_type(&self) -> &str
fn driver_type(&self) -> &str
get driver_type from manager: ConnManager