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

Function write_index_entry

perro_source/io_stack/perro_assets/src/common.rs:92–110  ·  view source on GitHub ↗
(
    writer: &mut W,
    path: &str,
    meta: &PerroAssetsEntryMeta,
)

Source from the content-addressed store, hash-verified

90 io::ErrorKind::InvalidData,
91 format!("Unsupported PerroAssets entry flags {flags:#x}"),
92 ));
93 }
94
95 Ok((
96 path,
97 PerroAssetsEntryMeta {
98 offset,
99 size,
100 original_size,
101 flags,
102 },
103 ))
104}
105
106pub fn write_index_entry<W: Write>(
107 writer: &mut W,
108 path: &str,
109 meta: &PerroAssetsEntryMeta,
110) -> io::Result<()> {
111 let path_bytes = path.as_bytes();
112 if path_bytes.len() > u16::MAX as usize {
113 return Err(io::Error::new(io::ErrorKind::InvalidInput, "Path too long"));

Callers 2

Calls 3

write_allMethod · 0.80
as_bytesMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected