Package io.polywrap.wasm
Class WasmWrapper
-
- All Implemented Interfaces:
public final class WasmWrapper implements Wrapper, AutoCloseable
Represents a WebAssembly (Wasm) wrapper for executing Wasm code.
-
-
Field Summary
Fields Modifier and Type Field Description private final <Error class: unknown class>ffiWrapper
-
Constructor Summary
Constructors Constructor Description WasmWrapper(ByteArray wasmModule)Creates a new WasmWrapper instance with the given Wasm module. WasmWrapper(<Error class: unknown class> ffiWrapper)
-
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()-
-
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 formatenv- Env variables for the wrapper invocation, encoded in the MessagePack byte formatinvoker- 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 formatenv- Env variables for the wrapper invocation, encoded in the MessagePack byte formatinvoker- The Invoker will be used for any sub-invocations that occur.
-
close
<Error class: unknown class> close()
-
-
-
-