pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for creating a configuration from multiple sources.
ConfigBuilder allows users to specify multiple sources for configuration
(e.g., CLI, files, environment variables) and merges their data.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn add_source<S>(self, src: S) -> Self
pub fn add_source<S>(self, src: S) -> Self
Add a configuration source.
Accepts any entity implementing the ConfigSource trait and adds it to
the list of sources to be loaded.
Sourcepub fn load(self) -> Result<ConfigValue, ParserError>
pub fn load(self) -> Result<ConfigValue, ParserError>
Load and merge all configuration sources.
Sources are sorted by priority (highest first) and merged sequentially, ensuring that later sources override earlier ones.
Trait Implementations§
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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