Wasm::Wasmtime::FuncType - Wasmtime function type class
version 0.23
use Wasm::Wasmtime; my $functype = Wasm::Wasmtime::FuncType->new( # This function type takes a 32 bit and 64 bit # integer and returns a double floating point [ 'i32', 'i64' ] => [ 'f64' ], );
WARNING: WebAssembly and Wasmtime are a moving target and the interface for these modules is under active development. Use with caution.
The function type class represents a function signature, that is the parameter and return types that a function will take.
my $functype = Wasm::Wasmtime::FuncType->new(\@params, \@results);
Creates a new function type instance. @params
and @results
should be a list of either Wasm::Wasmtime::ValType objects, or the string representation of those types (i32
, f64
, etc).
my @params = $functype->params;
Returns a list of the parameter types for the function type, as Wasm::Wasmtime::ValType objects.
my @params = $functype->results;
Returns a list of the result types for the function type, as Wasm::Wasmtime::ValType objects.
my $string = $functype->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.