MCPcopy Create free account
hub / github.com/PerroEngine/Perro / read

Method read

perro_source/io_stack/perro_assets/src/archive.rs:214–226  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

212 .map_err(|_| io::Error::new(io::ErrorKind::InvalidData, "archive entry too large"))?;
213 let end = start
214 .checked_add(size)
215 .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, "archive range overflow"))?;
216 if end > data_len {
217 return Err(io::Error::new(
218 io::ErrorKind::InvalidData,
219 "archive entry outside data bounds",
220 ));
221 }
222 Ok(start..end)
223}
224
225/// Streaming file handle (for uncompressed files only)
226pub struct PerroAssetsFile {
227 data: ArchiveBytes,
228 size: u64,
229 // Validated once at `stream_file`; reads index the cached range instead of

Callers 15

hash_indexMethod · 0.45
get_project_rootFunction · 0.45
mounted_dlc_namesFunction · 0.45
read_mounted_dlc_fileFunction · 0.45
resolve_pathFunction · 0.45
load_assetFunction · 0.45
stream_assetFunction · 0.45
load_dlc_static_binaryFunction · 0.45
load_static_binaryFunction · 0.45
localization_getMethod · 0.45

Calls 5

checked_entry_rangeFunction · 0.85
copy_from_sliceMethod · 0.80
lenMethod · 0.45
getMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected