MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / wasmtime_module_deserialize_file

Function wasmtime_module_deserialize_file

crates/c-api/src/module.rs:218–231  ·  view source on GitHub ↗
(
    engine: &wasm_engine_t,
    path: *const c_char,
    out: &mut *mut wasmtime_module_t,
)

Source from the content-addressed store, hash-verified

216
217#[unsafe(no_mangle)]
218pub unsafe extern "C" fn wasmtime_module_deserialize_file(
219 engine: &wasm_engine_t,
220 path: *const c_char,
221 out: &mut *mut wasmtime_module_t,
222) -> Option<Box<wasmtime_error_t>> {
223 let path = CStr::from_ptr(path);
224 let result = path
225 .to_str()
226 .context("input path is not valid utf-8")
227 .and_then(|path| Module::deserialize_file(&engine.engine, path));
228 handle_result(result, |module| {
229 *out = Box::into_raw(Box::new(wasmtime_module_t { module }));
230 })
231}

Callers 1

deserialize_fileMethod · 0.85

Calls 4

handle_resultFunction · 0.85
to_strMethod · 0.80
newFunction · 0.50
contextMethod · 0.45

Tested by

no test coverage detected