pub struct SettingsLoader { /* private fields */ }Expand description
Settings loader that merges from multiple sources.
Implementations§
Source§impl SettingsLoader
impl SettingsLoader
pub fn new() -> Self
Sourcepub async fn load(&mut self, project_dir: &Path) -> ConfigResult<&Settings>
pub async fn load(&mut self, project_dir: &Path) -> ConfigResult<&Settings>
Loads settings from all levels (enterprise + user + project + local). Priority (lowest to highest): Enterprise → User → Project → Local. Enterprise settings lock keys and cannot be overridden by lower levels.
Sourcepub async fn load_from(&mut self, base_dir: &Path) -> ConfigResult<&Settings>
pub async fn load_from(&mut self, base_dir: &Path) -> ConfigResult<&Settings>
Loads settings from a single base directory. Use this for loading from a specific resource level.
Sourcepub async fn load_local(
&mut self,
project_dir: &Path,
) -> ConfigResult<&Settings>
pub async fn load_local( &mut self, project_dir: &Path, ) -> ConfigResult<&Settings>
Loads only local settings (settings.local.json).
pub fn settings(&self) -> &Settings
pub fn into_settings(self) -> Settings
Trait Implementations§
Source§impl Debug for SettingsLoader
impl Debug for SettingsLoader
Source§impl Default for SettingsLoader
impl Default for SettingsLoader
Source§fn default() -> SettingsLoader
fn default() -> SettingsLoader
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SettingsLoader
impl RefUnwindSafe for SettingsLoader
impl Send for SettingsLoader
impl Sync for SettingsLoader
impl Unpin for SettingsLoader
impl UnwindSafe for SettingsLoader
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
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.