Trait rbdc::pool::Pool

source ·
pub trait Pool: Sync + Send + Debug {
    // Required methods
    fn new(manager: ConnManager) -> Result<Self, Error>
       where Self: Sized;
    fn get<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_timeout<'life0, 'async_trait>(
        &'life0 self,
        d: Duration
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_max_idle_conns<'life0, 'async_trait>(
        &'life0 self,
        n: u64
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_max_open_conns<'life0, 'async_trait>(
        &'life0 self,
        n: u64
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn driver_type(&self) -> &str;

    // Provided methods
    fn set_timeout<'life0, 'async_trait>(
        &'life0 self,
        _timeout: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn set_conn_max_lifetime<'life0, 'async_trait>(
        &'life0 self,
        _max_lifetime: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn state<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Value> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

source

fn new(manager: ConnManager) -> Result<Self, Error>
where Self: Sized,

create an Pool,use ConnManager

source

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

get an connection from pool

source

fn get_timeout<'life0, 'async_trait>( &'life0 self, d: Duration ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get timeout from pool

source

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

source

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

source

fn driver_type(&self) -> &str

get driver_type from manager: ConnManager

Provided Methods§

source

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

source

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

source

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

return state

Implementors§