pub async fn load_config(
file_path: Option<&Path>,
db_settings: HashMap<String, String>,
) -> Result<AppConfig, ConfigError>Expand description
Load configuration from file and environment
Order of precedence (highest to lowest):
- Environment variables (DBRST_*)
- Config file values
- Default values
§Arguments
file_path- Optional path to configuration filedb_settings- Optional settings loaded from database (deferred to Phase 3)
§Examples
ⓘ
let config = load_config(Some(Path::new("config.toml")), HashMap::new()).await?;