aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Execution/FuncInst.php
blob: 901fa815b6cb76f7cc90ee87afe2f5ed6a807fe4 (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\Execution;

use Nsfisis\Waddiwasi\Structure\Modules\Func;
use Nsfisis\Waddiwasi\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);
    }
}