MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / read_manifest

Function read_manifest

atomic-repository/src/intent_evidence.rs:205–213  ·  view source on GitHub ↗

Read a manifest within the protocol ceiling.

(path: &Path)

Source from the content-addressed store, hash-verified

203
204/// Read a manifest within the protocol ceiling.
205pub fn read_manifest(path: &Path) -> Result<Vec<u8>, EvidenceError> {
206 let file = std::fs::File::open(path)?;
207 let mut bytes = Vec::new();
208 file.take(MANIFEST_LIMIT + 1).read_to_end(&mut bytes)?;
209 if bytes.len() as u64 > MANIFEST_LIMIT {
210 return Err(EvidenceError::ManifestTooLarge);
211 }
212 Ok(bytes)
213}
214
215/// Read and replay a manifest file. Relative artifact roots resolve against the
216/// manifest's parent directory.

Callers 2

replayFunction · 0.70
replay_evidenceFunction · 0.50

Calls 2

openFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected