Crate wasmer_wasix

Source
Expand description

Wasmer’s WASI implementation

Use generate_import_object to create an [Imports]. This [Imports] can be combined with a module to create an Instance which can execute WASI Wasm functions.

See state for the experimental WASI FS API. Also see the WASI plugin example for an example of how to extend WASI using the WASI FS API.

Re-exportsΒ§

pub use crate::fs::Fd;
pub use crate::fs::VIRTUAL_ROOT_FD;
pub use crate::fs::WasiFs;
pub use crate::fs::WasiInodes;
pub use crate::fs::default_fs_backing;
pub use crate::os::WasiTtyState;
pub use crate::os::task::control_plane::WasiControlPlane;
pub use crate::os::task::process::WasiProcess;
pub use crate::os::task::process::WasiProcessId;
pub use crate::os::task::thread::WasiThread;
pub use crate::os::task::thread::WasiThreadError;
pub use crate::os::task::thread::WasiThreadHandle;
pub use crate::os::task::thread::WasiThreadId;
pub use crate::runtime::PluggableRuntime;
pub use crate::runtime::Runtime;
pub use crate::runtime::task_manager::VirtualTaskManager;
pub use wasmer;
pub use wasmer_wasix_types;
pub use virtual_fs;
pub use virtual_net;

ModulesΒ§

bin_factory
capabilities
fs
http
journal
macros πŸ”’
Macros to simplify some common WASI-specific tasks.
net
os
rewind πŸ”’
runners
runtime
state πŸ”’
WARNING: the API exposed here is unstable and very experimental. Certain things are not ready yet and may be broken in patch releases. If you’re using this and have any specific needs, please let us know here or by filing an issue.
syscalls πŸ”’
types
utils πŸ”’

StructsΒ§

DeepSleepWork
Represents the work that will be done when a thread goes to deep sleep and includes the things needed to restore it again
DuplexPipe
A pair of pipes that are connected together.
ExtendedFsError
LocalNetworking
LocalTcpListener
LocalTcpStream
LocalUdpSocket
Pipe
RewindState
The rewind state after a deep sleep
StoreSnapshot
A snapshot that captures the runtime state of an instance.
UnsupportedVirtualNetworking
WasiEnv
The environment provided to the WASI imports.
WasiEnvBuilder
Builder API for configuring a WasiEnv environment needed to run WASI modules.
WasiEnvInit
Data required to construct a WasiEnv.
WasiFunctionEnv
WasiModuleInstanceHandles
Various TypedFunction and Global handles for an active WASI(X) instance.
WasiVFork

EnumsΒ§

FsError
Error type for external users
SpawnError
WasiError
This is returned in RuntimeError. Use downcast or downcast_ref to retrieve the ExitCode.
WasiModuleTreeHandles
WasiRuntimeError
WasiStateCreationError
Error type returned when bad data is given to WasiEnvBuilder.
WasiVersion
The version of WASI. This is determined by the imports namespace string.

ConstantsΒ§

ALL_RIGHTS
all the rights enabled

TraitsΒ§

RewindPostProcess
Trait that will be invoked after the rewind has finished It is possible that the process will be terminated rather than restored at this point
VirtualFile
This trait relies on your file closing when it goes out of scope via Drop
VirtualNetworking
An implementation of virtual networking

FunctionsΒ§

block_in_place πŸ”’
Run a synchronous function that would normally be blocking.
capture_store_snapshot
generate_import_object_from_env
Create an [Imports] with an existing WasiEnv. WasiEnv values are typically constructed with WasiEnvBuilder.
generate_import_object_snapshot0 πŸ”’
Combines a state generating function with the import list for legacy WASI
generate_import_object_snapshot1 πŸ”’
generate_import_object_wasix32_v1 πŸ”’
Combines a state generating function with the import list for snapshot 1
generate_import_object_wasix64_v1 πŸ”’
get_wasi_version
Detect the version of WASI being used based on the import namespaces.
get_wasi_versions
Like get_wasi_version but detects multiple WASI versions in a single module. Thus strict behaves differently in this function as multiple versions are always supported. strict indicates whether non-WASI imports should trigger a failure or be ignored.
import_object_for_all_wasi_versions πŸ”’
io_err_into_net_error
is_wasi_module
Check if a provided module is compiled for some version of WASI. Use get_wasi_version to find out which version of WASI the module is.
is_wasix_module
Returns if the module is WASIX or not
mem_error_to_wasi πŸ”’
restore_store_snapshot
rewind
rewind_ext
run_wasi_func πŸ”’
run_wasi_func_start πŸ”’
Run a main function.
spawn_blocking πŸ”’
Spawns a new blocking task that runs the provided closure.
unwind
wait_for_snapshot
wasi_exports_generic πŸ”’
wasi_snapshot_preview1_exports πŸ”’
wasi_unstable_exports πŸ”’
wasix_exports_32 πŸ”’
wasix_exports_64 πŸ”’

Type AliasesΒ§

RewindStateOption
WasiBidirectionalSharedPipePair
Shared version of BidiPipe for situations where you need to emulate the old behaviour of Pipe (both send and recv on one channel).
WasiResult