pub trait PooledConnection:
Send
+ Sync
+ 'static {
// Required methods
fn is_healthy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn created_at(&self) -> Instant;
fn last_activity(&self) -> Instant;
fn update_activity(&mut self);
fn clone_connection(&self) -> Box<dyn PooledConnection>;
}Expand description
Generic connection trait
Required Methods§
Sourcefn is_healthy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_healthy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if connection is healthy
Sourcefn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the connection
Sourcefn created_at(&self) -> Instant
fn created_at(&self) -> Instant
Get connection creation time
Sourcefn last_activity(&self) -> Instant
fn last_activity(&self) -> Instant
Get last activity time
Sourcefn update_activity(&mut self)
fn update_activity(&mut self)
Update last activity time
Sourcefn clone_connection(&self) -> Box<dyn PooledConnection>
fn clone_connection(&self) -> Box<dyn PooledConnection>
Clone the connection (custom method for trait object compatibility)
Trait Implementations§
Source§impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection> to enable trait object usage
impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection> to enable trait object usage
Source§fn is_healthy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_healthy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if connection is healthy
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the connection
Source§fn created_at(&self) -> Instant
fn created_at(&self) -> Instant
Get connection creation time
Source§fn last_activity(&self) -> Instant
fn last_activity(&self) -> Instant
Get last activity time
Source§fn update_activity(&mut self)
fn update_activity(&mut self)
Update last activity time
Source§fn clone_connection(&self) -> Box<dyn PooledConnection>
fn clone_connection(&self) -> Box<dyn PooledConnection>
Clone the connection (custom method for trait object compatibility)
Implementations on Foreign Types§
Source§impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection> to enable trait object usage
impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection> to enable trait object usage