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::default_fs_backing;
pub use crate::fs::Fd;
pub use crate::fs::WasiFs;
pub use crate::fs::WasiInodes;
pub use crate::fs::VIRTUAL_ROOT_FD;
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::os::WasiTtyState;
pub use crate::runtime::task_manager::VirtualTaskManager;
pub use crate::runtime::PluggableRuntime;
pub use crate::runtime::Runtime;
pub use wasmer;
pub use wasmer_wasix_types;
pub use virtual_fs;
pub use virtual_net;
Modules§
Structs§
- Represents the work that will be done when a thread goes to deep sleep and includes the things needed to restore it again
- A pair of pipes that are connected together.
- Local
Networking host-vnet
- Local
TcpListener host-vnet
- Local
TcpStream host-vnet
- Local
UdpSocket host-vnet
- The rewind state after a deep sleep
- A snapshot that captures the runtime state of an instance.
- The environment provided to the WASI imports.
- Builder API for configuring a
WasiEnv
environment needed to run WASI modules. - Data required to construct a
WasiEnv
. - Various
TypedFunction
andGlobal
handles for an active WASI(X) instance.
Enums§
- Error type for external users
- This is returned in
RuntimeError
. Usedowncast
ordowncast_ref
to retrieve theExitCode
. - Error type returned when bad data is given to
WasiEnvBuilder
. - The version of WASI. This is determined by the imports namespace string.
Constants§
- all the rights enabled
Traits§
- 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
- This trait relies on your file closing when it goes out of scope via
Drop
- An implementation of virtual networking
Functions§
- Create an
Imports
with an existingWasiEnv
.WasiEnv
needs a [WasiState
], that can be constructed from aWasiEnvBuilder
. - Detect the version of WASI being used based on the import namespaces.
- Like
get_wasi_version
but detects multiple WASI versions in a single module. Thusstrict
behaves differently in this function as multiple versions are always supported.strict
indicates whether non-WASI imports should trigger a failure or be ignored. - io_
err_ into_ net_ error host-vnet
- 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. - Returns if the module is WASIX or not
Type Aliases§
- Shared version of BidiPipe for situations where you need to emulate the old behaviour of
Pipe
(both send and recv on one channel).