Trait DBBackend

Source
pub trait DBBackend<'c, DB>
where DB: Database,
{ // Required method fn backend_db( self, ) -> impl Future<Output = Result<(DBType, Either<impl Executor<'c, Database = DB>, PoolConnection<DB>>), Error>> + Send; }
Expand description

Trait for database connections/pools that can detect their backend type

§Type Parameters

  • 'c: Connection lifetime
  • DB: Database type implementing [sqlx::Database]
  • C1: Dereference target type (must be Any)

§Required Implementations

Automatically implemented for types that:

§Provided Methods

backend_db: Default implementation using the module-level function

Required Methods§

Source

fn backend_db( self, ) -> impl Future<Output = Result<(DBType, Either<impl Executor<'c, Database = DB>, PoolConnection<DB>>), Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'c, DB, C, C1> DBBackend<'c, DB> for C
where DB: Database, C: Executor<'c, Database = DB> + 'c + Deref<Target = C1>, C1: Any,