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

Represents a wasi module instance.

Implementations§

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.

Trait Implementations§

Returns the name of this exported module instance.

If this module instance is an active instance, return None.

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

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

Returns the exported function instance in this module instance by the given function name.

Argument

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

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

Returns the exported global instance in this module instance by the given global name.

Argument

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

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

Returns the exported memory instance in this module instance by the given memory name.

Argument

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

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

Returns the exported table instance in this module instance by the given table name.

Argument
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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 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.