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§
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>
Trait Implementations§
Source§impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection>
impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection>
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>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection>
impl PooledConnection for Box<dyn PooledConnection>
Implement PooledConnection for Box<dyn PooledConnection>