Wasm::Wasmtime::GlobalType - Wasmtime global type class
version 0.23
use Wasm::Wasmtime; my $globaltype = Wasm::Wasmtime::GlobalType->new('i32','var');
WARNING: WebAssembly and Wasmtime are a moving target and the interface for these modules is under active development. Use with caution.
This class represents a module global type.
my $globaltype = Wasm::Wasmtime::GlobalType->new( $valtype, # Wasm::Wasmtime::ValType $mutability, # 'const' or 'var' );
Creates a new global type object.
As a shortcut, the type names (ie i32
, etc) maybe used instead of a Wasm::Wasmtime::ValType for $valtype
.
$mutability
must be one of
cost
var
my $valtype = $globaltype->content;
Returns the Wasm::Wasmtime::ValType for this global type.
my $mutable = $globaltype->mutability;
Returns the mutability for this global type. One of either const
or var
.
my $string = $globaltype->to_string;
Converts the type into a string for diagnostics.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2020-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.