pub struct Scanner;Expand description
A small facade for finding the ConfigFiles relevant for the current
binary crate.
Implementations§
Source§impl Scanner
impl Scanner
Sourcepub fn find_config_files(dir_name: Option<&str>) -> Vec<ConfigFile>
pub fn find_config_files(dir_name: Option<&str>) -> Vec<ConfigFile>
Discovers and returns all ConfigFiles relevant to the current binary
crate and the active [AppProfile].
The returned vector is ordered for precedence: later files in the list should override earlier files when keys overlap.
§Search Location
Scans for configuration files within the resolved configuration directory.
§Supported Formats
The following file formats are recognized:
- TOML (
.toml) - YAML (
.yml,.yaml)
§File Types
- Generic config files: Apply to all profiles.
- Pattern:
config/{any_name}.{ext}
- Pattern:
- Profile-specific config files: Apply only if the file’s profile
matches the active [
AppProfile].- Patterns:
config/{any_name}.{profile}.{ext}config/{profile}/{any_name}.{ext}
- Patterns:
§Ordering
- Generic files always precede profile-specific files.
- Within each group (generic and profile-specific), files are ordered lexicographically by full path.
§Notes
- File and directory names are matched case-insensitively.
§Returns
An ordered Vec<ConfigFile> containing all discovered configuration
files.
Auto Trait Implementations§
impl Freeze for Scanner
impl RefUnwindSafe for Scanner
impl Send for Scanner
impl Sync for Scanner
impl Unpin for Scanner
impl UnwindSafe for Scanner
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