pub trait Connector {
    // Required methods
    fn get_connection<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &'static str;
    fn should_retry_on_transient_error(&self) -> bool;
}

Required Methods§

source

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

Returns a connection to a data source.

source

fn name(&self) -> &'static str

Returns the name of the connector.

source

fn should_retry_on_transient_error(&self) -> bool

Returns whether a connector should retry an entire transaction when that transaction failed during its execution because of a transient transaction error. Note: This is specific to MongoDB for now.

Implementors§