pub struct ConfigLoader { /* private fields */ }Expand description
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn new() -> ConfigLoader
pub fn new() -> ConfigLoader
Creates a new loader with default settings.
Sourcepub fn with_global_config(self, path: impl Into<PathBuf>) -> ConfigLoader
pub fn with_global_config(self, path: impl Into<PathBuf>) -> ConfigLoader
Sets a custom global config path.
Sourcepub fn with_project_root(self, path: impl Into<PathBuf>) -> ConfigLoader
pub fn with_project_root(self, path: impl Into<PathBuf>) -> ConfigLoader
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>) -> ConfigLoader
pub fn with_profile(self, name: impl Into<String>) -> ConfigLoader
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) -> ConfigLoader
pub fn with_env_overrides(self, overrides: EnvOverrides) -> ConfigLoader
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) -> ConfigLoader
pub fn skip_env_vars(self) -> ConfigLoader
Skips environment variable loading.
Useful for testing with deterministic config.
Sourcepub fn skip_global_config(self) -> ConfigLoader
pub fn skip_global_config(self) -> ConfigLoader
Skips global config loading.
Sourcepub fn skip_project_config(self) -> ConfigLoader
pub fn skip_project_config(self) -> ConfigLoader
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigLoader
impl Debug for ConfigLoader
Source§impl Default for ConfigLoader
impl Default for ConfigLoader
Source§fn default() -> ConfigLoader
fn default() -> ConfigLoader
Auto Trait Implementations§
impl Freeze for ConfigLoader
impl RefUnwindSafe for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnsafeUnpin for ConfigLoader
impl UnwindSafe for ConfigLoader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more