MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / search_load_config

Function search_load_config

load_config/src/lib.rs:46–62  ·  view source on GitHub ↗
(
    name: &str,
    search_paths: &[&str],
    default_toml: &str,
    leaf_config: Option<&str>,
    nested: bool,
)

Source from the content-addressed store, hash-verified

44}
45
46fn search_load_config(
47 name: &str,
48 search_paths: &[&str],
49 default_toml: &str,
50 leaf_config: Option<&str>,
51 nested: bool,
52) -> Figment {
53 let mut figment = Figment::from(rocket::Config::default())
54 .merge(Toml::string(default_toml).maybe_nested(nested));
55 for path in search_paths {
56 figment = load_config_in_dir(name, path, nested, figment);
57 }
58 match leaf_config {
59 Some(path) => load_config_file(path, nested, figment),
60 None => figment,
61 }
62}
63
64pub fn load_config(
65 name: &str,

Callers 4

load_configFunction · 0.85
test_search_load_configFunction · 0.85
test_search_load_config2Function · 0.85

Calls 3

load_config_in_dirFunction · 0.85
load_config_fileFunction · 0.85
maybe_nestedMethod · 0.80

Tested by 3

test_search_load_configFunction · 0.68
test_search_load_config2Function · 0.68