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§
Required Methods§
sourcefn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>
fn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>
Connect with dsn without connection checking.
sourcefn client_version() -> &'static str
fn client_version() -> &'static str
Get client version.
sourcefn 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 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.
sourcefn ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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,
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.
Provided Methods§
sourcefn pool_builder(self) -> PoolBuilder<Manager<Self>>
fn pool_builder(self) -> PoolBuilder<Manager<Self>>
deadpool::managed::PoolBuilder generation from config.
fn default_pool_config(&self) -> PoolConfig
sourcefn with_pool_config(self, config: PoolConfig) -> RawResult<Pool<Manager<Self>>>
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.