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::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§
- macros 🔒Macros to simplify some common WASI-specific tasks.
- rewind 🔒
- 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 🔒
- utils 🔒
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.
- 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§
- Run a synchronous function that would normally be blocking.
- Create an [
Imports
] with an existingWasiEnv
.WasiEnv
needs a [WasiState
], that can be constructed from aWasiEnvBuilder
. - Combines a state generating function with the import list for legacy WASI
- Combines a state generating function with the import list for snapshot 1
- 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
- Run a main function.
- Spawns a new blocking task that runs the provided closure.
- No-op module initializer.
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).