wasmedge_sdk::config

Struct CompilerConfigOptions

Source
pub struct CompilerConfigOptions { /* private fields */ }
Available on crate feature aot only.
Expand description

Defines a group of configuration options for AOT compiler.

CompilerConfigOptions is used to set the AOT compiler related configuration options, which are

  • Compiler Optimization Levels

    • O0 performs as many optimizations as possible.

    • O1 optimizes quickly without destroying debuggability

    • 02 optimizes for fast execution as much as possible without triggering significant incremental compile time or code size growth

    • O3 optimizes for fast execution as much as possible

    • Os optimizes for small code size as much as possible without triggering significant incremental compile time or execution time slowdowns

    • Oz optimizes for small code size as much as possible

  • Compiler Output Formats

    • Native specifies the output format is native dynamic library (*.wasm.so)
    • Wasm specifies the output format is WebAssembly with AOT compiled codes in custom section (*.wasm).
  • dump_ir determines if AOT compiler generates IR or not

  • generic_binary determines if AOT compiler generates the generic binary or not.

  • interruptible determines if AOT compiler generates interruptible binary or not.

The configuration options above are only effective to AOT compiler.

Implementations§

Source§

impl CompilerConfigOptions

Source

pub fn new() -> Self

Creates a new instance of CompilerConfigOptions.

Source

pub fn out_format(self, format: CompilerOutputFormat) -> Self

Sets the output binary format of AOT compiler.

§Argument
  • format specifies the format of the output binary.
Source

pub fn optimization_level(self, level: CompilerOptimizationLevel) -> Self

Sets the optimization level of AOT compiler.

§Argument
  • level specifies the optimization level of AOT compiler.
Source

pub fn dump_ir(self, enable: bool) -> Self

Sets the dump IR option of AOT compiler.

§Argument
  • enable specifies if dump ir or not.
Source

pub fn generic_binary(self, enable: bool) -> Self

Sets the generic binary option of AOT compiler.

§Argument
  • enable specifies if generate the generic binary or not when perform AOT compilation.
Source

pub fn interruptible(self, enable: bool) -> Self

Enables or Disables the Interruptible option of AOT compiler.

This option determines to generate interruptible binary or not when compilation in AOT compiler.

§Argument
  • enable specifies if turn on the Interruptible option.

Trait Implementations§

Source§

impl Clone for CompilerConfigOptions

Source§

fn clone(&self) -> CompilerConfigOptions

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompilerConfigOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompilerConfigOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for CompilerConfigOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.