Skip to main content

ConnectionFactory

Trait ConnectionFactory 

Source
pub trait ConnectionFactory<T>: Send + Sync {
    // Required method
    fn create(&self) -> Pin<Box<dyn Future<Output = Result<T>> + Send>>;

    // Provided method
    fn is_healthy(&self, _conn: &T) -> bool { ... }
}
Expand description

Factory trait for creating new connections

Required Methods§

Source

fn create(&self) -> Pin<Box<dyn Future<Output = Result<T>> + Send>>

Create a new connection asynchronously

Provided Methods§

Source

fn is_healthy(&self, _conn: &T) -> bool

Check if a connection is still healthy

Implementors§