pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for Config with precedence: flags > env > file > defaults
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn from_defaults() -> Self
pub fn from_defaults() -> Self
Start with default configuration
Sourcepub fn with_file(self, path: Option<PathBuf>) -> Result<Self>
pub fn with_file(self, path: Option<PathBuf>) -> Result<Self>
Layer config file (overrides defaults)
Deprecated: Use with_explicit_config() instead for –config flag handling
Sourcepub fn with_user_config(self) -> Result<Self>
pub fn with_user_config(self) -> Result<Self>
Layer user config (overrides defaults)
Sourcepub fn with_project_config(self) -> Result<Self>
pub fn with_project_config(self) -> Result<Self>
Layer project config (overrides user config and defaults)
Sourcepub fn with_explicit_config(self, path: PathBuf) -> Result<Self>
pub fn with_explicit_config(self, path: PathBuf) -> Result<Self>
Layer explicit config from –config flag (overrides discovered configs)
Sourcepub fn with_env(self) -> Result<Self>
pub fn with_env(self) -> Result<Self>
Layer environment variables (overrides file and defaults)
Sourcepub fn with_flags(self, cli: &Cli) -> Self
pub fn with_flags(self, cli: &Cli) -> Self
Layer CLI flags (highest precedence)
Note: CLI flags completely override environment variables and config file values for the same setting. For example, –schema replaces CQLITE_SCHEMA entirely rather than merging paths. This ensures clear precedence semantics.
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more