Trait taos_query::AsyncTBuilder

source ·
pub trait AsyncTBuilder: Sized + Send + Sync + 'static {
    type Target: Send + Sync + 'static;

    // Required methods
    fn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>;
    fn client_version() -> &'static str;
    fn ping<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _: &'life1 mut Self::Target
    ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn ready<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn build<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = RawResult<Self::Target>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn pool(self) -> RawResult<Pool<Manager<Self>>> { ... }
    fn pool_builder(self) -> PoolBuilder<Manager<Self>> { ... }
    fn default_pool_config(&self) -> PoolConfig { ... }
    fn with_pool_config(
        self,
        config: PoolConfig
    ) -> RawResult<Pool<Manager<Self>>> { ... }
}
Expand description

A struct is Connectable when it can be build from a Dsn.

Required Associated Types§

source

type Target: Send + Sync + 'static

Required Methods§

source

fn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>

Connect with dsn without connection checking.

source

fn client_version() -> &'static str

Get client version.

source

fn ping<'life0, 'life1, 'async_trait>( &'life0 self, _: &'life1 mut Self::Target ) -> Pin<Box<dyn Future<Output = RawResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check a connection is still alive.

source

fn ready<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if it’s ready to connect.

In most cases, just return true. r2d2 will use this method to check if it’s valid to create a connection. Just check the address is ready to connect.

source

fn build<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = RawResult<Self::Target>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new connection from this struct.

Provided Methods§

source

fn pool(self) -> RawResult<Pool<Manager<Self>>>

Build connection pool with deadpool::managed::Pool.

Default:

  • max_size: 500
source

fn pool_builder(self) -> PoolBuilder<Manager<Self>>

deadpool::managed::PoolBuilder generation from config.

source

fn default_pool_config(&self) -> PoolConfig

source

fn with_pool_config(self, config: PoolConfig) -> RawResult<Pool<Manager<Self>>>

Build connection pool with deadpool::managed::PoolBuilder

Object Safety§

This trait is not object safe.

Implementors§