Function liboverdrop::scan
source · pub fn scan<BdS: AsRef<Path>, BdI: IntoIterator<Item = BdS>, Sp: AsRef<Path>, As: AsRef<OsStr>>(
base_dirs: BdI,
shared_path: Sp,
allowed_extensions: &[As],
ignore_dotfiles: bool
) -> BTreeMap<OsString, PathBuf>
Expand description
Scan unique configuration fragments from the configuration directories specified.
Arguments
base_dirs
- Base components of directories where configuration fragments are located.shared_path
- Common relative path from each entry inbase_dirs
to the directory holding configuration fragments.allowed_extensions
- Only scan files that have an extension listed inallowed_extensions
. If an empty slice is passed, then all extensions are allowed.ignore_dotfiles
- Whether to ignore dotfiles (hidden files with name prefixed with ‘.’).
shared_path
is joined onto each entry in base_dirs
to form the directory paths to scan.
Returns a BTreeMap
indexed by configuration fragment filename,
holding the path where the unique configuration fragment is located.
Configuration fragments are stored in the BTreeMap
in alphanumeric order by filename.
Configuration fragments existing in directories that are scanned later override fragments
of the same filename in directories that are scanned earlier.