Trait db_pool::async::BackendTrait

source ·
pub trait BackendTrait:
    Sized
    + Send
    + Sync
    + 'static {
    type Pool: Send;
    type BuildError: Debug + Send;
    type PoolError: Debug + Send;
    type ConnectionError: Debug;
    type QueryError: Debug;

    // Required methods
    fn init<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid,
        restrict_privileges: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clean<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn drop<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid,
        is_restricted: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Backend trait

Required Associated Types§

source

type Pool: Send

Connection pool type that implements Send

source

type BuildError: Debug + Send

Connection pool build error type that implements Debug and Send

source

type PoolError: Debug + Send

Connection pool error type that implements Debug and Send

source

type ConnectionError: Debug

Connection error type that implements Debug

source

type QueryError: Debug

Query error type that implements Debug

Required Methods§

source

fn init<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initializes the backend

source

fn create<'life0, 'async_trait>( &'life0 self, db_id: Uuid, restrict_privileges: bool, ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a database

source

fn clean<'life0, 'async_trait>( &'life0 self, db_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cleans a database

source

fn drop<'life0, 'async_trait>( &'life0 self, db_id: Uuid, is_restricted: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drops a database

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Backend for SeaORMMySQLBackend

source§

type Pool = DatabaseConnection

source§

type BuildError = BuildError

source§

type PoolError = PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = QueryError

source§

impl Backend for SeaORMPostgresBackend

source§

type Pool = DatabaseConnection

source§

type BuildError = BuildError

source§

type PoolError = PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = QueryError

source§

impl Backend for SqlxMySQLBackend

source§

type Pool = Pool<MySql>

source§

type BuildError = BuildError

source§

type PoolError = PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = QueryError

source§

impl Backend for SqlxPostgresBackend

source§

type Pool = Pool<Postgres>

source§

type BuildError = BuildError

source§

type PoolError = PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = QueryError

source§

impl<P: DieselPoolAssociation<AsyncMysqlConnection>> Backend for DieselAsyncMySQLBackend<P>

source§

type Pool = <P as DieselPoolAssociation<AsyncMysqlConnection>>::Pool

source§

type BuildError = <P as DieselPoolAssociation<AsyncMysqlConnection>>::BuildError

source§

type PoolError = <P as DieselPoolAssociation<AsyncMysqlConnection>>::PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = Error

source§

impl<P: DieselPoolAssociation<AsyncPgConnection>> Backend for DieselAsyncPostgresBackend<P>

source§

type Pool = <P as DieselPoolAssociation<AsyncPgConnection>>::Pool

source§

type BuildError = <P as DieselPoolAssociation<AsyncPgConnection>>::BuildError

source§

type PoolError = <P as DieselPoolAssociation<AsyncPgConnection>>::PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = Error

source§

impl<P: TokioPostgresPoolAssociation> Backend for TokioPostgresBackend<P>

source§

type Pool = <P as TokioPostgresPoolAssociation>::Pool

source§

type BuildError = <P as TokioPostgresPoolAssociation>::BuildError

source§

type PoolError = <P as TokioPostgresPoolAssociation>::PoolError

source§

type ConnectionError = ConnectionError

source§

type QueryError = QueryError