Wasm::Wasmtime::ExportType - Wasmtime export type class
version 0.23
use Wasm::Wasmtime; my $module = Wasm::Wasmtime::Module->new(wat => q{ (module (func (export "foo") (param i32 i32) (result i32) local.get 0 local.get 1 i32.add) (memory (export "bar") 2 3) ) }); my($foo, $bar) = @{ $module->exports }; print $foo->name, "\n"; # foo print $foo->type->kind, "\n"; # func print $bar->name, "\n"; # bar print $bar->type->kind, "\n"; # memory
This class represents an export 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 exportable objects.
my $exporttype = Wasm::Wasmtime::ExportType->new( $name, # string $externtype, # Wasm::Wasmtime::ExternType );
Creates a new export type object.
my $name = $exporttype->name;
Returns the name of the export.
my $externtype = $exporttype->type;
Returns the Wasm::Wasmtime::ExternType for the export.
my $string = $exporttype->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.