Class Instance
Represents an instantiated WebAssembly module.
Inheritance
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public class Instance : object
Constructors
| Improve this Doc View SourceInstance(Store, Module, Object[])
Creates a new WebAssembly instance.
Declaration
public Instance(Store store, Module module, params object[] imports)
Parameters
Type | Name | Description |
---|---|---|
Store | store | The store to create the instance in. |
Module | module | The module to create the instance for. |
System.Object[] | imports | The imports for the instance. |
Methods
| Improve this Doc View SourceGetAction(String)
Gets an exported function from the instance.
Declaration
public Action? GetAction(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action> | Returns the function if a function of that name and type was exported or null if not. |
GetAction<TA>(String)
Gets an exported function from the instance.
Declaration
public Action<TA>? GetAction<TA>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action<TA>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | Parameter type |
GetAction<TA, TB>(String)
Gets an exported function from the instance.
Declaration
public Action<TA, TB>? GetAction<TA, TB>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action<TA, TB>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
GetAction<TA, TB, TC>(String)
Gets an exported function from the instance.
Declaration
public Action<TA, TB, TC>? GetAction<TA, TB, TC>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action<TA, TB, TC>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
GetAction<TA, TB, TC, TD>(String)
Gets an exported function from the instance.
Declaration
public Action<TA, TB, TC, TD>? GetAction<TA, TB, TC, TD>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action<TA, TB, TC, TD>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
GetAction<TA, TB, TC, TD, TE>(String)
Gets an exported function from the instance.
Declaration
public Action<TA, TB, TC, TD, TE>? GetAction<TA, TB, TC, TD, TE>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Action<TA, TB, TC, TD, TE>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
GetFunction(String)
Gets an exported function from the instance.
Declaration
public Function GetFunction(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
Function | Returns the function if a function of that name was exported or null if not. |
GetFunction(String, Nullable<Type>, Type[])
Gets an exported function from the instance and check the type signature.
Declaration
public Function GetFunction(string name, Type? returnType, params Type[] parameterTypes)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
System.Nullable<Type> | returnType | The return type of the function. Null if no return type. Tuple of types is multiple returns expected. |
Type[] | parameterTypes | The expected parameters to the function |
Returns
Type | Description |
---|---|
Function | Returns the function if a function of that name and type signature was exported or null if not. |
GetFunction<TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TR>? GetFunction<TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TL | Twelfth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TL | Twelfth parameter type |
TM | Thirteenth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TL | Twelfth parameter type |
TM | Thirteenth parameter type |
TN | Fourteenth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TL | Twelfth parameter type |
TM | Thirteenth parameter type |
TN | Fourteenth parameter type |
TO | Fifteenth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TP, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TP, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TP, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TP, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TI | Ninth parameter type |
TJ | Tenth parameter type |
TK | Eleventh parameter type |
TL | Twelfth parameter type |
TM | Thirteenth parameter type |
TN | Fourteenth parameter type |
TO | Fifteenth parameter type |
TP | Sixteenth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TR>? GetFunction<TA, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TR>? GetFunction<TA, TB, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TR>? GetFunction<TA, TB, TC, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TR>? GetFunction<TA, TB, TC, TD, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TR>? GetFunction<TA, TB, TC, TD, TE, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TR | Return type. Use a tuple for multiple return values |
GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TR>(String)
Gets an exported function from the instance.
Declaration
public Func<TA, TB, TC, TD, TE, TF, TG, TH, TR>? GetFunction<TA, TB, TC, TD, TE, TF, TG, TH, TR>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported function. |
Returns
Type | Description |
---|---|
System.Nullable<Func<TA, TB, TC, TD, TE, TF, TG, TH, TR>> | Returns the function if a function of that name and type was exported or null if not. |
Type Parameters
Name | Description |
---|---|
TA | First parameter type |
TB | Second parameter type |
TC | Third parameter type |
TD | Fourth parameter type |
TE | Fifth parameter type |
TF | Sixth parameter type |
TG | Seventh parameter type |
TH | Eighth parameter type |
TR | Return type. Use a tuple for multiple return values |
GetGlobal(String)
Gets an exported global from the instance.
Declaration
public Global GetGlobal(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported global. |
Returns
Type | Description |
---|---|
Global | Returns the global if a global of that name was exported or null if not. |
GetMemory(String)
Gets an exported memory from the instance.
Declaration
public Memory GetMemory(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported memory. |
Returns
Type | Description |
---|---|
Memory | Returns the memory if a memory of that name was exported or null if not. |
GetTable(String)
Gets an exported table from the instance.
Declaration
public Table GetTable(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the exported table. |
Returns
Type | Description |
---|---|
Table | Returns the table if a table of that name was exported or null if not. |