🌻 📖 Wasm::Wasmtime::WasiInstance

NAME

Wasm::Wasmtime::WasiInstance - WASI instance class

VERSION

version 0.23

SYNOPSIS

 use Wasm::Wasmtime;
 
 my $store = Wasm::Wasmtime::Store->new;
 my $wasi  = Wasm::Wasmtime::WasiInstance->new(
   $store,
   "wasi_snapshot_preview1",
 );

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 the WebAssembly System Interface (WASI). For WebAssembly WASI is the equivalent to the part of libc that interfaces with the system.

To configure if and how the WASI accesses program argument, environment, standard streams and file system directories, see Wasm::Wasmtime::WasiConfig.

For a complete example of using WASI from WebAssembly, see the synopsis for Wasm::Wasmtime::Linker.

CONSTRUCTOR

new

 my $wasi = Wasm::Wasmtime::WasiInstance->new(
   $store,   # Wasm::Wasmtime::Store,
   $name,    # string
   $config,  # Wasm::Wasmtime::WasiConfig,
 );
 my $wasi = Wasm::Wasmtime::WasiInstance->new(
   $store,   # Wasm::Wasmtime::Store,
   $name,    # string
 );

Create a new WASI instance.

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.