Wasm::Wasmtime::ValType - Wasmtime value type class
version 0.23
use Wasm::Wasmtime; my $valtype = Wasm::Wasmtime::ValType->new('i32');
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.
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.
my $kind = $valtype->kind;
Returns the value type as a string (ie i32
).
my $kind = $valtype->kind_num;
Returns the number used internally to represent the type.
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.
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.