aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/FuncInst.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/WebAssembly/Execution/FuncInst.php')
-rw-r--r--src/WebAssembly/Execution/FuncInst.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/WebAssembly/Execution/FuncInst.php b/src/WebAssembly/Execution/FuncInst.php
new file mode 100644
index 0000000..dda32cf
--- /dev/null
+++ b/src/WebAssembly/Execution/FuncInst.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\WebAssembly\Execution;
+
+use Nsfisis\Waddiwasi\WebAssembly\Structure\Modules\Func;
+use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\FuncType;
+
+abstract readonly class FuncInst
+{
+ final public static function Wasm(FuncType $type, ModuleInst $module, Func $code): FuncInsts\Wasm
+ {
+ return new FuncInsts\Wasm($type, $module, $code);
+ }
+
+ final public static function Host(FuncType $type, callable $callback): FuncInsts\Host
+ {
+ return new FuncInsts\Host($type, $callback);
+ }
+}