🌻 📖 Wasm::Wasmtime::MemoryType

NAME

Wasm::Wasmtime::MemoryType - Wasmtime memory type class

VERSION

version 0.23

SYNOPSIS

 use Wasm::Wasmtime;
 
 # new memory type with minimum 3 and maximum 5 pages
 my $memorytype = Wasm::Wasmtime::MemoryType->new([3,5]);

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 module memory type. It models the minimum and maximum number of pages.

CONSTRUCTOR

new

 my $memorytype = Wasm::Wasmtime::MemoryType->new([
   $min,  # minumum number of pages
   $max   # maximum number of pages
 ]);

Creates a new memory type object.

limits

 my $limits = $memorytype->limits;

Returns the minimum and maximum number of pages as an array reference.

to_string

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