* \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
| 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. |