Closed zacharywhitley closed 3 years ago
No. The purpose of wrapper interfaces defined in WasmFunctions
is to provide a Java-native APIs to interact with wasm functions. Java has no support for multi return value, so there's no straight mapping possible.
You can just use Func
class directly to obtain array of results, and/or give it handler that stores multiple result values.
Func func = new Func(store, fnType,
(caller, params, results) -> {
results[0] = ...;
results[1] = ...;
return Optional.empty();
});
Thanks. Just what I was looking for.
Is there any way to return a multi-value from a wrapped function?