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

Method load_or_default

dstack-util/src/host_api.rs:43–53  ·  view source on GitHub ↗
(url: Option<String>)

Source from the content-addressed store, hash-verified

41 }
42
43 pub fn load_or_default(url: Option<String>) -> Result<Self> {
44 let api = match url {
45 Some(url) => Self::new(Some(url), None),
46 None => {
47 let local_config: SysConfig =
48 deserialize_json_file(format!("{HOST_SHARED_DIR}/{SYS_CONFIG}"))?;
49 Self::new(local_config.host_api_url, local_config.pccs_url)
50 }
51 };
52 Ok(api)
53 }
54
55 pub async fn notify(&self, event: &str, payload: &str) -> Result<()> {
56 match Platform::detect_or_dstack() {

Callers

nothing calls this directly

Calls 1

deserialize_json_fileFunction · 0.85

Tested by

no test coverage detected