[][src]Function wasmer_runtime::compile

pub fn compile(bytes: &[u8]) -> Result<Module, Box<dyn Error + 'static>>

Compile WebAssembly binary code into a Module. This function is useful if it is necessary to compile a module before it can be instantiated (otherwise, the instantiate function should be used).

Params

  • wasm: A &[u8] containing the binary code of the wasm module you want to compile.

Errors

If the operation fails, the function returns Err(error::CompileError::...).

This function only exists if one of default-backend-llvm, default-backend-cranelift, or default-backend-singlepass is set.