pub unsafe fn create_runtime_from_artifact_bytes<H>(
    compiled_artifact_bytes: &[u8],
    config: Config
) -> Result<WasmtimeRuntime, WasmError>where
    H: HostFunctions,
Expand description

The same as create_runtime but takes the bytes of a precompiled artifact, which makes this function considerably faster than create_runtime, but slower than the more optimized create_runtime_from_artifact. This is especially slow on non-Linux Unix systems. Useful in very niche cases.

Safety

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

  1. produced by prepare_runtime_artifact,
  2. was not modified,

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.