pub struct WasiModule { /* private fields */ }
Expand description

A WasiModule is a module instance for the WASI specification.

Implementations§

Creates a WASI host module which contains the WASI host functions, and initializes it with the given parameters.

Arguments
  • args - The commandline arguments. The first argument is the program name.

  • envs - The environment variables in the format ENV_VAR_NAME=VALUE.

  • preopens - The directories to pre-open. The required format is DIR1:DIR2.

Error

If fail to create a host module, then an error is returned.

Initializes the WASI host module with the given parameters.

Arguments
  • args - The commandline arguments. The first argument is the program name.

  • envs - The environment variables in the format ENV_VAR_NAME=VALUE.

  • preopens - The directories to pre-open. The required format is DIR1:DIR2.

Returns the WASI exit code.

The WASI exit code can be accessed after running the “_start” function of a wasm32-wasi program.

Returns the native handler from the mapped FD/Handler.

Argument
  • fd - The WASI mapped Fd.
Error

If fail to get the native handler, then an error is returned.

Provides a raw pointer to the inner module instance context.

Trait Implementations§

Returns the name of the module instance.

Returns the length of the exported function instances in this module instance.

Returns the names of the exported function instances in this module instance.

Returns the length of the exported table instances in this module instance.

Returns the names of the exported table instances in this module instance.

Returns the length of the exported memory instances in this module instance.

Returns the names of all exported memory instances in this module instance.

Returns the length of the exported global instances in this module instance.

Returns the names of the exported global instances in this module instance.

Returns the exported function instance by name. Read more
Returns the exported table instance by name. Read more
Returns the exported memory instance by name. Read more
Returns the exported global instance by name. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.