pub unsafe fn create_runtime_from_artifact<H>(
    compiled_artifact_path: &Path,
    config: Config
) -> Result<WasmtimeRuntime, WasmError>
where H: HostFunctions,
Expand description

The same as create_runtime but takes a path to a precompiled artifact, which makes this function considerably faster than create_runtime.

Safety

The caller must ensure that the compiled artifact passed here was:

  1. produced by prepare_runtime_artifact,
  2. written to the disk as a file,
  3. was not modified,
  4. will not be modified while any runtime using this artifact is alive, or is being instantiated.

Failure to adhere to these requirements might lead to crashes and arbitrary code execution.

It is ok though if the compiled artifact was created by code of another version or with different configuration flags. In such case the caller will receive an Err deterministically.