pub struct DatabaseConfig {
pub url: String,
pub password: Option<String>,
pub password_file: Option<String>,
pub max_connections: Option<u32>,
pub min_connections: Option<u32>,
pub connection_timeout: Option<Duration>,
pub max_lifetime: Option<Duration>,
pub idle_timeout: Option<Duration>,
pub test_before_acquire: Option<bool>,
}
Fields§
§url: String
§password: Option<String>
§password_file: Option<String>
§max_connections: Option<u32>
§min_connections: Option<u32>
§connection_timeout: Option<Duration>
§max_lifetime: Option<Duration>
§idle_timeout: Option<Duration>
§test_before_acquire: Option<bool>
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
pub fn get_database_url(&self) -> Result<String, ConfigError>
pub fn get_pool_options(&self) -> Result<PoolOptions<AnyDB>, ConfigError>
pub fn resolve(&self) -> Result<ResolvedDatabaseConfig, ConfigError>
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl<'de> Deserialize<'de> for DatabaseConfig
impl<'de> Deserialize<'de> for DatabaseConfig
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
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
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