Wasm::Wasmtime::Global - Wasmtime global class
version 0.23
use Wasm::Wasmtime; my $store = Wasm::Wasmtime::Store->new; my $global = Wasm::Wasmtime::Global->new( $store, Wasm::Wasmtime::GlobalType->new('i32','var'), 42, ); print $global->get, "\n"; # 42 $global->set(99); print $global->get, "\n"; # 99
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 WebAssembly global object.
my $global = Wasm::Wasmtime::Global->new( $store, # Wasm::Wasmtime::Store $globaltype, # Wasm::Wasmtime::GlobalType );
Creates a new global object.
my $globaltype = $global->type;
Returns the Wasm::Wasmtime::GlobalType object for this global object.
my $value = $global->get;
Gets the global value.
my $global->set($value);
Sets the global to the given value.
my $ref = $global->tie;
Returns a reference to a tied scalar that can be used to get/set the global.
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.