pub struct SettingsEnv { /* private fields */ }Expand description
An EnvSource with the settings/profile
fallback — the value form of get_env_var.
Reads the real process environment first, then the active profile’s env
(or the base env when no profile is active) in
$HOME/.omni-dev/settings.json.
Pass &SettingsEnv::load() from a thin production wrapper; tests inject a
pure MapEnv into the same *_with(&impl EnvSource, …) seam instead of
mutating the process environment.
Implementations§
Source§impl SettingsEnv
impl SettingsEnv
Sourcepub fn load() -> Self
pub fn load() -> Self
Loads settings from the default location, falling back to an empty
settings map if they are absent or unreadable (env-only behaviour). The
active profile is read from OMNI_DEV_PROFILE.
Sourcepub fn load_with_profile(profile: Option<&str>) -> Self
pub fn load_with_profile(profile: Option<&str>) -> Self
Like load but with the active profile supplied
explicitly — for tests and embedders that select a profile without
setting OMNI_DEV_PROFILE in the process environment.