NAME
Wasm::Wasmtime::ValType - Wasmtime value type class
VERSION
version 0.23
SYNOPSIS
use Wasm::Wasmtime;
my $valtype = Wasm::Wasmtime::ValType->new('i32');
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 a Wasm type.
CONSTRUCTOR
new
my $valtype = Wasm::Wasmtime::ValType->new($type);
Creates a new value type instance. Acceptable values for $type
are:
i32
-
Signed 32 bit integer.
i64
-
Signed 64 bit integer.
f32
-
Floating point.
f64
-
Double precision floating point.
anyref
-
A pointer.
funcref
-
A function pointer.
METHODS
kind
my $kind = $valtype->kind;
Returns the value type as a string (ie i32
).
kind_num
my $kind = $valtype->kind_num;
Returns the number used internally to represent the type.
to_string
my $string = $valtype->to_string;
Converts the type into a string for diagnostics. For this class, this does the same thing as the kind method.
SEE ALSO
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.