Class WasmWrapper

  • All Implemented Interfaces:

    
    public final class WasmWrapper
     implements Wrapper, AutoCloseable
                        

    Represents a WebAssembly (Wasm) wrapper for executing Wasm code.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final <Error class: unknown class> ffiWrapper
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final <Error class: unknown class> getFfiWrapper()
      List<UByte> )>invoke(String method, List<UByte> args, List<UByte> env, <Error class: unknown class> invoker) Invokes a method in the Wrapper with the specified options and invoker.
      Result<ByteArray> invoke(String method, ByteArray args, ByteArray env, Invoker invoker) Invokes a method in the Wrapper with the specified options and invoker.
      <Error class: unknown class> close()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WasmWrapper

        WasmWrapper(ByteArray wasmModule)
        Creates a new WasmWrapper instance with the given Wasm module.
        Parameters:
        wasmModule - The WebAssembly module as a ByteArray.
      • WasmWrapper

        WasmWrapper(<Error class: unknown class> ffiWrapper)
        Parameters:
        ffiWrapper - The underlying FFI wrapper instance.
    • Method Detail

      • getFfiWrapper

         final <Error class: unknown class> getFfiWrapper()
      • invoke

         List<UByte> )>invoke(String method, List<UByte> args, List<UByte> env, <Error class: unknown class> invoker)

        Invokes a method in the Wrapper with the specified options and invoker.

        Parameters:
        method - The method to be called on the wrapper.
        args - Arguments for the method, encoded in the MessagePack byte format
        env - Env variables for the wrapper invocation, encoded in the MessagePack byte format
        invoker - The invoker will be used for any sub-invocations that occur.
      • invoke

         Result<ByteArray> invoke(String method, ByteArray args, ByteArray env, Invoker invoker)

        Invokes a method in the Wrapper with the specified options and invoker.

        Parameters:
        method - The method to be called on the wrapper.
        args - Arguments for the method, encoded in the MessagePack byte format
        env - Env variables for the wrapper invocation, encoded in the MessagePack byte format
        invoker - The Invoker will be used for any sub-invocations that occur.
      • close

         <Error class: unknown class> close()