pub struct DatabaseConfig {
pub host: String,
pub port: u16,
pub name: String,
pub username: String,
pub password: Option<String>,
pub pool_size: usize,
}Expand description
Example of a manually defined configuration using the schema system
Fields§
§host: String§port: u16§name: String§username: String§password: Option<String>§pool_size: usizeImplementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn schema() -> ConfigSchema
pub fn schema() -> ConfigSchema
Create configuration schema for DatabaseConfig
Trait Implementations§
Source§impl AppConfigTrait for DatabaseConfig
impl AppConfigTrait for DatabaseConfig
Source§fn from_env() -> Result<Self, ConfigError>
fn from_env() -> Result<Self, ConfigError>
Load configuration from environment variables
Source§fn config_sources(&self) -> HashMap<String, ConfigSource>
fn config_sources(&self) -> HashMap<String, ConfigSource>
Get configuration source information for debugging
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