MCPcopy Create free account
hub / github.com/argumentcomputer/ix / test_name_roundtrip

Function test_name_roundtrip

crates/ixon/src/serialize.rs:2168–2183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2166 Self::get_inner(buf, false)
2167 }
2168
2169 /// [`Self::get`], keeping each `Named`'s §5 metadata window as
2170 /// verbatim bytes (one shared arena) decoded on demand instead of
2171 /// parsing it here — see [`LazyMetaWindow`]. The structured metadata
2172 /// for a whole env costs a large multiple of its encoding (and
2173 /// eagerly parsing it dominated the decompile pre-phase), so
2174 /// consumers that read metadata a bounded number of times per entry
2175 /// (decompile, `import_ixe`) use this to keep structured residency
2176 /// to one entry at a time and pay decode cost only for entries they
2177 /// touch. Trade-off: interior §5 corruption that [`Self::get`]
2178 /// rejects at load surfaces here as a panic on first decode (the
2179 /// window *framing* is still validated at load).
2180 pub fn get_demoted_named(buf: &mut &[u8]) -> Result<Self, String> {
2181 Self::get_inner(buf, true)
2182 }
2183
2184 fn get_inner(buf: &mut &[u8], demote_named: bool) -> Result<Self, String> {
2185 // Per-section read attribution behind the same knobs as the write
2186 // side (`IX_VERBOSE` / `IX_COMPILE_DBG` — see `put_file`): this

Callers

nothing calls this directly

Calls 3

put_nameFunction · 0.85
get_nameFunction · 0.85
as_sliceMethod · 0.80

Tested by

no test coverage detected