ClientFactory

Trait ClientFactory 

Source
pub trait ClientFactory:
    Default
    + Send
    + Sync
    + 'static {
    type Client: Client;

    // Required method
    fn get_client<'life0, 'life1, 'async_trait>(
        &'life0 self,
        address: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Client>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A factory object for Postgres clients. This abstracts details of client creation such as pooling.

Required Associated Types§

Source

type Client: Client

The type of client produced by get_client.

Required Methods§

Source

fn get_client<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::Client>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets a client from the factory.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§