Struct wasmedge_sdk::Compiler

source ·
pub struct Compiler { /* private fields */ }
Expand description

Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.

Implementations§

Creates a new AOT compiler.

Error

If fail to create a AOT compiler, then an error is returned.

Compiles the given wasm file into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.

Arguments
  • wasm_file - The target wasm file.

  • filename - The filename of the generated shared library file.

  • out_dir - The target directory to save the generated shared library file.

Error

If fail to compile, then an error is returned.

Compiles the given wasm bytes into a shared library file (*.so in Linux, *.dylib in macOS, or *.dll in Windows). The file path of the generated shared library file will be returned if the method works successfully.

Argument
  • bytes - A in-memory WASM bytes.

  • filename - The filename of the generated shared library file.

  • out_dir - The target directory to save the generated shared library file.

Error

If fail to compile, then an error is returned.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.