pub struct ConfigLoader { /* private fields */ }Expand description
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn with_global_config(self, path: impl Into<PathBuf>) -> Self
pub fn with_global_config(self, path: impl Into<PathBuf>) -> Self
Sets a custom global config path.
Sourcepub fn with_project_root(self, path: impl Into<PathBuf>) -> Self
pub fn with_project_root(self, path: impl Into<PathBuf>) -> Self
Sets the project root directory.
Project config will be loaded from <project_root>/.orcs/config.toml.
Sourcepub fn with_profile(self, name: impl Into<String>) -> Self
pub fn with_profile(self, name: impl Into<String>) -> Self
Sets the profile to activate.
The profile’s [config] section is merged as a layer
between project config and env vars. The profile is
loaded from ProfileStore search dirs.
Sourcepub fn with_env_overrides(self, overrides: EnvOverrides) -> Self
pub fn with_env_overrides(self, overrides: EnvOverrides) -> Self
Injects pre-built environment overrides.
When set, load() uses these instead of reading std::env::var.
This enables deterministic testing without env mutation.
Ignored if skip_env_vars() is also called.
Sourcepub fn skip_env_vars(self) -> Self
pub fn skip_env_vars(self) -> Self
Skips environment variable loading.
Useful for testing with deterministic config.
Sourcepub fn skip_global_config(self) -> Self
pub fn skip_global_config(self) -> Self
Skips global config loading.
Sourcepub fn skip_project_config(self) -> Self
pub fn skip_project_config(self) -> Self
Skips project config loading.
Sourcepub fn load(&self) -> Result<OrcsConfig, ConfigError>
pub fn load(&self) -> Result<OrcsConfig, ConfigError>
Loads and merges configuration from all sources.
§Errors
Returns ConfigError if any config file exists but cannot be parsed.
Missing config files are silently ignored.
Trait Implementations§
Source§impl Clone for ConfigLoader
impl Clone for ConfigLoader
Source§fn clone(&self) -> ConfigLoader
fn clone(&self) -> ConfigLoader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more