NAME

Wasm::Wasmtime::ExportType - Wasmtime export type class

VERSION

version 0.23

SYNOPSIS

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

DESCRIPTION

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.

CONSTRUCTOR

new

my $exporttype = Wasm::Wasmtime::ExportType->new(
  $name,         # string
  $externtype,   # Wasm::Wasmtime::ExternType
);

Creates a new export type object.

METHODS

name

my $name = $exporttype->name;

Returns the name of the export.

type

my $externtype = $exporttype->type;

Returns the Wasm::Wasmtime::ExternType for the export.

to_string

my $string = $exporttype->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.