NAME
Wasm::Wasmtime::Instance - Wasmtime instance class
VERSION
version 0.01
SYNOPSIS
use Wasm::Wasmtime;
my $module = Wasm::Wasmtime::Module->new(wat => '(module)');
my $instance = Wasm::Wasmtime::Instance->new($module, []);
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 an instance of a WebAssembly module Wasm::Wasmtime::Module.
CONSTRUCTOR
new
my $instance = Wasm::Wasmtime::Instance->new(
$module # Wasm::Wasmtime::Module
);
my $instance = Wasm::Wasmtime::Instance->new(
$module, # Wasm::Wasmtime::Module
\@imports, # array reference of Wasm::Wasmtime::Extern
);
Create a new instance of the instance class.
METHODS
get_export
my $extern = $instance->get_export($name);
Returns a Wasm::Wasmtime::Extern object with the given $name
. If no such object exists, then undef
will be returned.
Extern objects represent functions, globals, tables or memory in WebAssembly.
module
my $module = $instance->module;
Returns the Wasm::Wasmtime::Module for this instance.
exports
my @externs = $instance->exports;
Returns a list of Wasm::Wasmtime::Extern objects for the functions, globals, tables and memory exported by the WebAssembly instance.
AUTHOR
Graham Ollis <plicease@cpan.org>
COPYRIGHT AND LICENSE
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.