BackendTrait

Trait 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

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 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