NAME

Wasm::Wasmtime::GlobalType - Wasmtime global type class

VERSION

version 0.23

SYNOPSIS

use Wasm::Wasmtime;

my $globaltype = Wasm::Wasmtime::GlobalType->new('i32','var');

DESCRIPTION

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.

CONSTRUCTOR

new

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

content

my $valtype = $globaltype->content;

Returns the Wasm::Wasmtime::ValType for this global type.

mutability

my $mutable = $globaltype->mutability;

Returns the mutability for this global type. One of either const or var.

to_string

my $string = $globaltype->to_string;

Converts the type into a string for diagnostics.

SEE ALSO

Wasm
Wasm::Wasmtime

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

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.