MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / load

Method load

cli/src/pkg.rs:23–29  ·  view source on GitHub ↗

Load the manifest, or an empty one when the file is absent.

(path: &Path)

Source from the content-addressed store, hash-verified

21impl Manifest {
22 /// Load the manifest, or an empty one when the file is absent.
23 pub fn load(path: &Path) -> Result<Self> {
24 if !path.exists() {
25 return Ok(Self::default());
26 }
27 let text = std::fs::read_to_string(path).with_context(|| format!("reading {}", path.display()))?;
28 serde_json::from_str(&text).with_context(|| format!("parsing {}", path.display()))
29 }
30
31 /// Write the manifest back as pretty JSON with a trailing newline.
32 fn save(&self, path: &Path) -> Result<()> {

Callers 8

plainFunction · 0.80
spinnerFunction · 0.80
runFunction · 0.80
worker.jsFile · 0.80
loadNativeModuleFunction · 0.80
allocMethod · 0.80
allocMethod · 0.80
allocMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected