The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wasm::Wasmtime::Trap - Wasmtime trap class

VERSION

version 0.11

SYNOPSIS

 use Wasm::Wasmtime;
 
 my $store = Wasm::Wasmtime::Store->new;
 my $trap = Wasm::Wasmtime::Trap->new(
   $store,
   "something went bump in the night\0",
 );

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 trap, usually something unexpected that happened in Wasm land. This is usually converted into an exception in Perl land, but you can create your own trap here.

CONSTRUCTORS

new

 my $trap = Wasm::Wasmtime::Trap->new(
   $store,    # Wasm::Wasmtime::Store
   $message,  # Null terminated string
 );

Create a trap instance. $message MUST be null terminated.

METHODS

message

 my $message = $trap->message;

Returns the trap message as a string.

SEE ALSO

Wasm
Wasm::Wasmtime

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 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.