Struct wasmedge_sys::FuncType

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

Defines the type of a host function.

A WasmEdge FuncType classifies the signature of a Function, including the type information of both the arguments and the returns.

Implementations§

Create a new FuncType to be associated with the given arguments and returns.

Arguments
  • args - The argument types of a Function.

  • returns - The types of the returns of a Function.

Error

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

Example
use wasmedge_sys::FuncType;
use wasmedge_types::ValType;

let func_ty = FuncType::create(vec![ValType::I32;2], vec![ValType::I32]).expect("fail to create a FuncType");

Returns the number of the arguments of a Function.

Returns an Iterator of the arguments of a Function.

Returns the number of the returns of a Function.

Returns an Iterator of the return types of a Function.

Provides a raw pointer to the inner function type context.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Converts to this type from the input type.
Converts to this type from the input type.

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.