MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / read_src

Function read_src

compiler/src/main/exports.rs:85–90  ·  view source on GitHub ↗

Copies up to SZ bytes from the host SRC buffer into an owned `String` so the caller can drop the runtime borrow before parsing. */

(len: usize)

Source from the content-addressed store, hash-verified

83
84/* Copies up to SZ bytes from the host SRC buffer into an owned `String` so the caller can drop the runtime borrow before parsing. */
85fn read_src(len: usize) -> Result<String, core::str::Utf8Error> {
86 with_runtime(|rt| {
87 let len = len.min(SZ);
88 core::str::from_utf8(&rt.src[..len]).map(|s| s.to_string())
89 })
90}
91
92/* Pre-fetch feed: each import as `b<TAB>name` (bare, resolve via manifest) or `q<TAB>spec` (quoted URL/path), one per line. */
93#[unsafe(no_mangle)]

Callers 3

extract_importsFunction · 0.85
run_startFunction · 0.85
runFunction · 0.85

Calls 1

with_runtimeFunction · 0.85

Tested by

no test coverage detected