Skip to main content

RdbmsClient

Trait RdbmsClient 

Source
pub trait RdbmsClient: SqlExecutor {
    // Required method
    fn transaction<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Transaction, RdbmsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn replica_lag<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<Duration>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn pool_size(&self) -> Option<u32> { ... }
}

Required Methods§

Source

fn transaction<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Transaction, RdbmsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn replica_lag<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Duration>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

副本延迟探针。None = 该后端不提供(默认),或此刻探测不出结果 (无复制、Seconds_Behind_* 为 NULL);路由按「未知就不跳过」处理。

Source

fn pool_size(&self) -> Option<u32>

该客户端配置的最大连接数(预算校验用);None = 后端不报告 (默认)。预算校验(ecat-data-sharding 的 validate_pool_budget) 对 None 按「未知」跳过,不会当成 0 连接。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§