aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/FuncInst.php
blob: dda32cfbdf014eb355100745d1c4651adbc6883c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
    }
}