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§
Sourcetype ConnectionError: Debug
type ConnectionError: Debug
Connection error type that implements Debug
Sourcetype QueryError: Debug
type QueryError: Debug
Query error type that implements Debug
Required Methods§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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,
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.