Struct FunctionResult<T>
A result from a function call which may represent a Value or a Trap
Implements
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public readonly struct FunctionResult<T> : IFunctionResult<FunctionResult<T>, T, FunctionResultBuilder<T>>
Type Parameters
Name | Description |
---|---|
T | Type of the return value contained in this result |
Properties
| Improve this Doc View SourceTrap
Get the trap associated with this result
Declaration
public readonly TrapException Trap { get; }
Property Value
Type | Description |
---|---|
TrapException |
Type
Indicates what type of result this contains
Declaration
public readonly ResultType Type { get; }
Property Value
Type | Description |
---|---|
ResultType |
Value
Get the value associated with this result
Declaration
public readonly T Value { get; }
Property Value
Type | Description |
---|---|
T |
Operators
| Improve this Doc View SourceExplicit(FunctionResult<T> to T)
Convert this result into a value, throw if it is a Trap
Declaration
public static explicit operator T(FunctionResult<T> value)
Parameters
Type | Name | Description |
---|---|---|
FunctionResult<T> | value |
Returns
Type | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
TrapException | Thrown if Type == Trap |