Class PanamaFuncType
java.lang.Object
ai.tegmentum.wasmtime4j.type.AbstractFuncType
ai.tegmentum.wasmtime4j.panama.type.PanamaFuncType
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.type.FuncType,ai.tegmentum.wasmtime4j.type.WasmType
public final class PanamaFuncType
extends ai.tegmentum.wasmtime4j.type.AbstractFuncType
Panama implementation of FuncType interface.
This class provides type introspection capabilities for WebAssembly function types using Panama Foreign Function Interface bindings to the native Wasmtime library.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPanamaFuncType(ai.tegmentum.wasmtime4j.WasmValueType[] params, ai.tegmentum.wasmtime4j.WasmValueType[] results, Arena arena, MemorySegment nativeHandle) Creates a PanamaFuncType from parameter and result arrays.PanamaFuncType(List<ai.tegmentum.wasmtime4j.WasmValueType> params, List<ai.tegmentum.wasmtime4j.WasmValueType> results, Arena arena, MemorySegment nativeHandle) Creates a new PanamaFuncType instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic PanamaFuncTypefromNative(MemorySegment nativeHandle, Arena arena) Creates a PanamaFuncType from native function type information.getArena()Gets the memory arena used by this function type.Gets the native handle for this function type.static PanamaFuncTypeof(List<ai.tegmentum.wasmtime4j.WasmValueType> params, List<ai.tegmentum.wasmtime4j.WasmValueType> results) Creates a PanamaFuncType from type information without a native handle.Methods inherited from class ai.tegmentum.wasmtime4j.type.AbstractFuncType
equals, getKind, getParams, getResults, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.tegmentum.wasmtime4j.type.FuncType
defaultValue, getFinality, getParamCount, getResultCount, getSupertype, matches, param, params, result, results
-
Constructor Details
-
PanamaFuncType
public PanamaFuncType(List<ai.tegmentum.wasmtime4j.WasmValueType> params, List<ai.tegmentum.wasmtime4j.WasmValueType> results, Arena arena, MemorySegment nativeHandle) Creates a new PanamaFuncType instance.- Parameters:
params- the parameter typesresults- the result typesarena- the memory arena for resource managementnativeHandle- the native handle to the function type
-
PanamaFuncType
public PanamaFuncType(ai.tegmentum.wasmtime4j.WasmValueType[] params, ai.tegmentum.wasmtime4j.WasmValueType[] results, Arena arena, MemorySegment nativeHandle) Creates a PanamaFuncType from parameter and result arrays.- Parameters:
params- the parameter types arrayresults- the result types arrayarena- the memory arena for resource managementnativeHandle- the native handle to the function type
-
-
Method Details
-
of
public static PanamaFuncType of(List<ai.tegmentum.wasmtime4j.WasmValueType> params, List<ai.tegmentum.wasmtime4j.WasmValueType> results) Creates a PanamaFuncType from type information without a native handle.This factory method is used when type information is parsed from JSON or other sources where a native handle is not available.
- Parameters:
params- the parameter typesresults- the result types- Returns:
- the PanamaFuncType instance
-
fromNative
Creates a PanamaFuncType from native function type information.- Parameters:
nativeHandle- the native handle to the function typearena- the memory arena for resource management- Returns:
- the PanamaFuncType instance
- Throws:
IllegalArgumentException- if nativeHandle is invalid
-
getNativeHandle
Gets the native handle for this function type.- Returns:
- the native handle
-
getArena
-