Wasm::Wasmtime::GlobalType - Wasmtime global type class
version 0.11
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.
i32
$valtype
$mutability must be one of
$mutability
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.
const
my $string = $globaltype->to_string;
Converts the type into a string for diagnostics.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2020 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.
To install Wasm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wasm
CPAN shell
perl -MCPAN -e shell install Wasm
For more information on module installation, please visit the detailed CPAN module installation guide.