Enum witnext::CallMode[][src]

pub enum CallMode {
    DefinedExport,
    DeclaredExport,
    DefinedImport,
    DeclaredImport,
}
Expand description

Modes of calling a WebAssembly or host function.

Each mode may have a slightly different codegen for some types, so Function::call takes this as a parameter to know in what context the invocation is happening within.

Variants

DefinedExport

A defined export is being called.

This typically means that a code generator is generating a shim function to get exported from a WebAssembly module and the shim is calling a native language function defined within the wasm module. In this mode arguments are being lifted from wasm types to interface types, and results are being lowered.

DeclaredExport

A declared export is being called.

This typically means that a code generator is generating calls to a WebAssembly module, for example a JS host calling a WebAssembly instance. In this mode the native language’s arguments are being lowered to wasm values and the results of the function are lifted back into the native language.

DefinedImport

A defined import is being called.

This is typically used for code generators that are creating bindings in a host for a function imported by WebAssembly. In this mode a function with a wasm signature is generated and that function’s wasm arguments are lifted into the native language’s arguments. The results are then lowered back into wasm arguments to return.

DeclaredImport

A declared import is being called

This is typically used for code generators that are calling an imported function from within a wasm module. In this mode native language arguments are lowered to wasm values, and the results of the import are lifted back into the native language.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.