* \brief Deserializes a module from an on-disk file. * * This function is the same as `deserialize` except that it reads the data * for the serialized module from the path on disk. This can be faster than * the alternative which may require copying the data around. * * It is not safe to pass arbitrary input to this function, it is only safe to * pass in output from previous ca
| 118 | * https://docs.wasmtime.dev/api/wasmtime/struct.Module.html#method.deserialize |
| 119 | */ |
| 120 | static Result<Module> deserialize_file(Engine &engine, |
| 121 | const std::string &path) { |
| 122 | wasmtime_module_t *ret = nullptr; |
| 123 | auto *error = |
| 124 | wasmtime_module_deserialize_file(engine.capi(), path.c_str(), &ret); |
| 125 | if (error != nullptr) { |
| 126 | return Error(error); |
| 127 | } |
| 128 | return Module(ret); |
| 129 | } |
| 130 | |
| 131 | /// Returns the list of types imported by this module. |
| 132 | ImportType::List imports() const { |
nothing calls this directly
no test coverage detected