pub struct Config { /* private fields */ }
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(db_type: ConfigDbType) -> Config
pub fn new(db_type: ConfigDbType) -> Config
create a new config instance
Sourcepub fn from_env_var(name: &str) -> Result<Config, Error>
pub fn from_env_var(name: &str) -> Result<Config, Error>
create a new Config instance from an environment variable that contains a URL
Sourcepub fn from_file_location<T: AsRef<Path>>(location: T) -> Result<Config, Error>
pub fn from_file_location<T: AsRef<Path>>(location: T) -> Result<Config, Error>
create a new Config instance from a config file located on the file system
pub fn set_db_path(self, db_path: &str) -> Config
pub fn set_trust_cert(&mut self)
pub fn db_type(&self) -> ConfigDbType
pub fn db_host(&self) -> Option<&str>
pub fn db_port(&self) -> Option<&str>
pub fn set_db_user(self, db_user: &str) -> Config
pub fn set_db_pass(self, db_pass: &str) -> Config
pub fn set_db_host(self, db_host: &str) -> Config
pub fn set_db_port(self, db_port: &str) -> Config
pub fn set_db_name(self, db_name: &str) -> Config
Trait Implementations§
Source§impl AsyncMigrate for Config
impl AsyncMigrate for Config
fn get_last_applied_migration<'life0, 'life1, 'async_trait>(
&'life0 mut self,
migration_table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Migration>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_applied_migrations<'life0, 'life1, 'async_trait>(
&'life0 mut self,
migration_table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Migration>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn migrate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
migrations: &'life1 [Migration],
abort_divergent: bool,
abort_missing: bool,
grouped: bool,
target: Target,
migration_table_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Report, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn assert_migrations_table_query(migration_table_name: &str) -> String
fn get_last_applied_migration_query(migration_table_name: &str) -> String
fn get_applied_migrations_query(migration_table_name: &str) -> String
Source§impl AsyncTransaction for Config
impl AsyncTransaction for Config
type Error = Infallible
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_queries: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Migrate for Config
impl Migrate for Config
fn get_last_applied_migration( &mut self, migration_table_name: &str, ) -> Result<Option<Migration>, Error>
fn get_applied_migrations( &mut self, migration_table_name: &str, ) -> Result<Vec<Migration>, Error>
fn migrate( &mut self, migrations: &[Migration], abort_divergent: bool, abort_missing: bool, grouped: bool, target: Target, migration_table_name: &str, ) -> Result<Report, Error>
fn assert_migrations_table_query(migration_table_name: &str) -> String
fn get_last_applied_migration_query(migration_table_name: &str) -> String
fn get_applied_migrations_query(migration_table_name: &str) -> String
fn assert_migrations_table( &mut self, migration_table_name: &str, ) -> Result<usize, Error>
fn get_unapplied_migrations( &mut self, migrations: &[Migration], abort_divergent: bool, abort_missing: bool, migration_table_name: &str, ) -> Result<Vec<Migration>, Error>
Source§impl Transaction for Config
impl Transaction for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more