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

Method deserialize

crates/c-api/include/wasmtime/module.hh:98–106  ·  view source on GitHub ↗

* \brief Deserializes a previous list of bytes created with `serialize`. * * This function is intended to be much faster than `compile` where it uses * the artifacts of a previous compilation to quickly create an in-memory * module ready for instantiation. * * It is not safe to pass arbitrary input to this function, it is only safe to * pass in output from previous calls to `s

Source from the content-addressed store, hash-verified

96 * https://docs.wasmtime.dev/api/wasmtime/struct.Module.html#method.deserialize
97 */
98 static Result<Module> deserialize(Engine &engine, Span<uint8_t> wasm) {
99 wasmtime_module_t *ret = nullptr;
100 auto *error = wasmtime_module_deserialize(engine.capi(), wasm.data(),
101 wasm.size(), &ret);
102 if (error != nullptr) {
103 return Error(error);
104 }
105 return Module(ret);
106 }
107
108 /**
109 * \brief Deserializes a module from an on-disk file.

Callers

nothing calls this directly

Calls 6

ErrorClass · 0.70
ModuleClass · 0.70
capiMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected