pub trait DatabaseAutoCreation:
Clone
+ Send
+ Sync
+ 'static {
type InstanceConfig;
// Required methods
fn new(instance: Self::InstanceConfig) -> Self;
fn with_schema(
instance: Self::InstanceConfig,
schema: DatabaseSchema,
) -> Self
where Self: Sized;
fn create_database_if_not_exists(
&self,
) -> impl Future<Output = Result<bool, AutoCreationError>> + Send;
fn create_tables_if_not_exist(
&self,
) -> impl Future<Output = Result<Vec<String>, AutoCreationError>> + Send;
fn verify_connection(
&self,
) -> impl Future<Output = Result<(), AutoCreationError>> + Send;
}Required Associated Types§
type InstanceConfig
Required Methods§
fn new(instance: Self::InstanceConfig) -> Self
fn with_schema(instance: Self::InstanceConfig, schema: DatabaseSchema) -> Selfwhere
Self: Sized,
fn create_database_if_not_exists( &self, ) -> impl Future<Output = Result<bool, AutoCreationError>> + Send
fn create_tables_if_not_exist( &self, ) -> impl Future<Output = Result<Vec<String>, AutoCreationError>> + Send
fn verify_connection( &self, ) -> impl Future<Output = Result<(), AutoCreationError>> + 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.