pub struct LoadedConfig { /* private fields */ }Expand description
Configuration load errors and the validated runtime policy derived from TOML. Validated configuration loaded from disk with its resolved file path.
Implementations§
Source§impl LoadedConfig
impl LoadedConfig
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Resolves, creates when appropriate, reads, and validates the active config.
Environment-specified configs must already exist, while default user locations can be bootstrapped with the built-in safe defaults.
Sourcepub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Loads and validates a config from an explicit path.
This bypasses automatic default creation and is used by tests and callers that already know which config file should be authoritative.
Sourcepub fn config(&self) -> &RuntimeConfig
pub fn config(&self) -> &RuntimeConfig
Returns the normalized runtime configuration.
Sourcepub fn into_config(self) -> RuntimeConfig
pub fn into_config(self) -> RuntimeConfig
Consumes the loaded config and returns its normalized runtime form.
Sourcepub fn config_dir(&self) -> PathBuf
pub fn config_dir(&self) -> PathBuf
Returns the directory that contains the active configuration file.
Sinks use this as the base for default relative storage decisions.
Trait Implementations§
Source§impl Clone for LoadedConfig
impl Clone for LoadedConfig
Source§fn clone(&self) -> LoadedConfig
fn clone(&self) -> LoadedConfig
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 LoadedConfig
impl Debug for LoadedConfig
Source§impl PartialEq for LoadedConfig
impl PartialEq for LoadedConfig
Source§fn eq(&self, other: &LoadedConfig) -> bool
fn eq(&self, other: &LoadedConfig) -> bool
self and other values to be equal, and is used by ==.