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

    Constructors
    Constructor
    Description
    PanamaFuncType(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 Type
    Method
    Description
    fromNative(MemorySegment nativeHandle, Arena arena)
    Creates a PanamaFuncType from native function type information.
    Gets the memory arena used by this function type.
    Gets the native handle for this function type.
    of(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, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods 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 types
      results - the result types
      arena - the memory arena for resource management
      nativeHandle - 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 array
      results - the result types array
      arena - the memory arena for resource management
      nativeHandle - 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 types
      results - the result types
      Returns:
      the PanamaFuncType instance
    • fromNative

      public static PanamaFuncType fromNative(MemorySegment nativeHandle, Arena arena)
      Creates a PanamaFuncType from native function type information.
      Parameters:
      nativeHandle - the native handle to the function type
      arena - the memory arena for resource management
      Returns:
      the PanamaFuncType instance
      Throws:
      IllegalArgumentException - if nativeHandle is invalid
    • getNativeHandle

      public MemorySegment getNativeHandle()
      Gets the native handle for this function type.
      Returns:
      the native handle
    • getArena

      public Arena getArena()
      Gets the memory arena used by this function type.
      Returns:
      the memory arena