Trait db_pool::sync::BackendTrait

source ·
pub trait BackendTrait:
    Sized
    + Send
    + Sync
    + 'static {
    type ConnectionManager: ManageConnection;
    type ConnectionError: Debug;
    type QueryError: Debug;

    // Required methods
    fn init(&self) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>;
    fn create(
        &self,
        db_id: Uuid,
        restrict_privileges: bool,
    ) -> Result<Pool<Self::ConnectionManager>, Error<Self::ConnectionError, Self::QueryError>>;
    fn clean(
        &self,
        db_id: Uuid,
    ) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>;
    fn drop(
        &self,
        db_id: Uuid,
        is_restricted: bool,
    ) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>;
}
Expand description

Backend trait

Required Associated Types§

source

type ConnectionManager: ManageConnection

Type that implements the r2d2::ManageConnection trait

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(&self) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>

Initializes the backend

source

fn create( &self, db_id: Uuid, restrict_privileges: bool, ) -> Result<Pool<Self::ConnectionManager>, Error<Self::ConnectionError, Self::QueryError>>

Creates a database

source

fn clean( &self, db_id: Uuid, ) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>

Cleans a database

source

fn drop( &self, db_id: Uuid, is_restricted: bool, ) -> Result<(), Error<Self::ConnectionError, Self::QueryError>>

Drops a database

Object Safety§

This trait is not object safe.

Implementors§