Wasm::Wasmtime::ImportType - Wasmtime import type class
version 0.23
use Wasm::Wasmtime; my $module = Wasm::Wasmtime::Module->new( wat => q{ (module (func $hello (import "xx" "hello")) ) }); my $hello = $module->imports->[0]; print $hello->module, "\n"; # xx print $hello->name, "\n"; # hello print $hello->type->kind, "\n"; # functype
This class represents an import from a module. It is essentially a name and an Wasm::Wasmtime::ExternType. The latter gives you the function signature and other configuration details for import objects.
my $importtype = Wasm::Wasmtime::ImportType->new( $module, # Wasm::Wasmtime::Module $name, # string $externtype, # Wasm::Wasmtime::FuncType, ::MemoryType, ::GlobalType or ::TableType );
Creates a new import type object.
my $name = $importtype->name;
Returns the name of the import.
my $externtype = $importtype->type;
Returns the Wasm::Wasmtime::ExternType for the import.
my $name = $importtype->module;
Returns the name of the module for the import.
my $string = $importtype->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.