MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / read

Method read

hail-fuzz/src/debugging/replay.rs:395–415  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

393 }
394
395 pub fn read(&self) -> anyhow::Result<Vec<u8>> {
396 match &self.kind {
397 PathKind::Path => {
398 let mut out = vec![];
399 self.compression
400 .open_reader(&self.path)
401 .with_context(|| format!("failed to read: {}", self.path.display()))?
402 .read_to_end(&mut out)?;
403 Ok(out)
404 }
405 PathKind::Tar { subpath } => {
406 let file_path = subpath.as_deref().ok_or_else(|| {
407 anyhow::format_err!(
408 "expected subpath for .tar archive: {}",
409 self.path.display()
410 )
411 })?;
412 read_within(&self.path, file_path, &self.compression)
413 }
414 }
415 }
416
417 pub fn read_child(&self, file: &Path) -> anyhow::Result<Vec<u8>> {
418 match &self.kind {

Callers 1

replayFunction · 0.45

Calls 2

read_withinFunction · 0.85
open_readerMethod · 0.80

Tested by

no test coverage detected