pub struct ConfigLoader<S: ConfigSchema> { /* private fields */ }Expand description
Builds and executes a layered configuration load.
Sources are merged in registration order (first = lowest priority).
Because sources are stored as Arc, the loader is cheaply cloneable and
its sources can be captured in hot-reload closures without duplicating state.
Implementations§
Source§impl<S: ConfigSchema> ConfigLoader<S>
impl<S: ConfigSchema> ConfigLoader<S>
Sourcepub fn with_source(self, source: impl Source + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl Source + Send + Sync + 'static) -> Self
Add a passive source (env vars, CLI args, etc.).
Passive sources are collected once at load time. In selective hot-reload
mode (watch_auto) their initial cache is
reused for every re-merge; they never trigger a reload themselves. Use
with_watched_source for
file-backed or redb sources that should trigger selective reloads.
pub fn with_migrations(self, migrations: MigrationChain) -> Self
pub fn with_encryptor(self, encryptor: impl Encryptor + 'static) -> Self
Trait Implementations§
Source§impl<S: ConfigSchema> Clone for ConfigLoader<S>
impl<S: ConfigSchema> Clone for ConfigLoader<S>
Source§impl<S: ConfigSchema> Default for ConfigLoader<S>
impl<S: ConfigSchema> Default for ConfigLoader<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ConfigLoader<S>
impl<S> !UnwindSafe for ConfigLoader<S>
impl<S> Freeze for ConfigLoader<S>where
PhantomData<S>: Freeze,
impl<S> Send for ConfigLoader<S>where
PhantomData<S>: Send,
impl<S> Sync for ConfigLoader<S>where
PhantomData<S>: Sync,
impl<S> Unpin for ConfigLoader<S>where
PhantomData<S>: Unpin,
impl<S> UnsafeUnpin for ConfigLoader<S>where
PhantomData<S>: UnsafeUnpin,
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