pub struct ConfigLoader { /* private fields */ }Expand description
Configuration loader that supports multiple sources.
Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn workspace_root(self, root: impl Into<PathBuf>) -> Self
pub fn workspace_root(self, root: impl Into<PathBuf>) -> Self
Set the workspace root directory.
Sourcepub fn config_file(self, path: impl Into<PathBuf>) -> Self
pub fn config_file(self, path: impl Into<PathBuf>) -> Self
Set a standalone configuration file path.
Sourcepub fn no_cargo_metadata(self) -> Self
pub fn no_cargo_metadata(self) -> Self
Disable loading from Cargo.toml metadata.
Sourcepub fn load(self) -> Result<(Config, PathBuf)>
pub fn load(self) -> Result<(Config, PathBuf)>
Load configuration from all enabled sources.
Priority (later sources override earlier):
- Default values
- Cargo.toml metadata (workspace then package)
- Standalone TOML file
- Profile overlay (
CARGO_IMAGE_RUNNER_PROFILE) - Individual env var overrides (
CARGO_IMAGE_RUNNER_*)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigLoader
impl RefUnwindSafe for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnsafeUnpin for ConfigLoader
impl UnwindSafe for ConfigLoader
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