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 wasmer;
pub use wasmer_wasix_types;
pub use virtual_fs;
pub use virtual_net;
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::task_manager::VirtualTaskManagerExt;
pub use crate::runtime::PluggableRuntime;
pub use crate::runtime::SpawnedMemory;
pub use crate::runtime::WasiRuntime;
pub use crate::wapm::parse_static_webc;
Modules
Structs
- A pair of pipes that are connected together.
- Represents the ID of a WASI calling thread
- 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 for external users
- 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
- The default stack size for WASIX
Traits
- This trait relies on your file closing when it goes out of scope via
Drop
- An implementation of virtual networking
- This trait relies on your file closing when it goes out of scope via
Drop
Functions
- Returns the current thread ID
- 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. - 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 Definitions
- Shared version of BidiPipe for situations where you need to emulate the old behaviour of
Pipe
(both send and recv on one channel).