type property

The declared type of the global.

Implementation

WasmGlobalExternType get type => scoped((arena) {
  final native = c.wasmtime_global_type(store.context, _native(arena));
  try {
    return WasmGlobalExternType(
      content: WasmValueKind.fromWasmKind(
        c.wasm_valtype_kind(c.wasm_globaltype_content(native)),
      ),
      mutable: c.wasm_globaltype_mutability(native) != 0,
    );
  } finally {
    c.wasm_globaltype_delete(native);
  }
});