barrel_design_module (barrel_design v0.1.0)
View SourceAdmission checks for a guest module (ABI barrel_v1).
Linking alone would accept an import of the right name with any signature, since a host fun takes the signature the guest declares. These checks run before any instantiation, on the decoded module:
- imports: only
barrel_v1.field(i32, i32, i32) -> i32,barrel_v1.emit(i32, i32, i32, i32),barrel_v1.input(i32, i32) -> i32andbarrel_v1.output(i32, i32), each at most once; - the export checked has its role's type: a map takes and returns nothing, a reducer takes the
rereduceflag (i32) and returns nothing. One module may export both; - exactly one memory, defined in the module, 32-bit, unshared, with a declared maximum within the view's page limit;
- no start function, no imported memory, table or global, tables bounded, no GC types or exception tags;
- no SIMD, atomics, exception or GC instructions.
Summary
Functions
Check a decoded module (from bytes or inline WAT).
Check portable bytes against their declared digest, then their contents (see check/3).
Functions
-spec check(tuple(), term(), #{export := binary(), max_memory_pages := pos_integer(), role => map | reduce}) -> {ok, map()} | {error, term()}.
Check a decoded module (from bytes or inline WAT).
-spec check_bytes(binary(), binary(), #{export := binary(), max_memory_pages := pos_integer(), role => map | reduce}) -> {ok, map()} | {error, term()}.
Check portable bytes against their declared digest, then their contents (see check/3).