Trait query_core::Connector
source · pub trait Connector {
// Required methods
fn get_connection<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + Send + Sync>, ConnectorError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn name(&self) -> &'static str;
fn should_retry_on_transient_error(&self) -> bool;
}
Required Methods§
sourcefn get_connection<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + Send + Sync>, ConnectorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_connection<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Connection + Send + Sync>, ConnectorError>> + Send + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,
Returns a connection to a data source.
sourcefn should_retry_on_transient_error(&self) -> bool
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.