Trait wasmer_wasix::runtime::Runtime
source · pub trait Runtimewhere
Self: Debug,{
Show 14 methods
// Required methods
fn networking(&self) -> &DynVirtualNetworking;
fn task_manager(&self) -> &Arc<dyn VirtualTaskManager>;
fn source(&self) -> Arc<dyn Source + Send + Sync>;
// Provided methods
fn package_loader(&self) -> Arc<dyn PackageLoader + Send + Sync> { ... }
fn module_cache(&self) -> Arc<dyn ModuleCache + Send + Sync> { ... }
fn engine(&self) -> Engine { ... }
fn new_store(&self) -> Store { ... }
fn http_client(&self) -> Option<&DynHttpClient> { ... }
fn tty(&self) -> Option<&(dyn TtyBridge + Send + Sync)> { ... }
fn load_module<'a>(
&'a self,
wasm: &'a [u8],
) -> BoxFuture<'a, Result<Module, SpawnError>> { ... }
fn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError> { ... }
fn on_taint(&self, _reason: TaintReason) { ... }
fn journals(&self) -> &Vec<Arc<DynJournal>> { ... }
fn active_journal(&self) -> Option<&DynJournal> { ... }
}
Expand description
Runtime components used when running WebAssembly programs.
Think of this as the “System” in “WebAssembly Systems Interface”.
Required Methods§
sourcefn networking(&self) -> &DynVirtualNetworking
fn networking(&self) -> &DynVirtualNetworking
Provides access to all the networking related functions such as sockets.
sourcefn task_manager(&self) -> &Arc<dyn VirtualTaskManager>
fn task_manager(&self) -> &Arc<dyn VirtualTaskManager>
Retrieve the active VirtualTaskManager
.
Provided Methods§
sourcefn package_loader(&self) -> Arc<dyn PackageLoader + Send + Sync>
fn package_loader(&self) -> Arc<dyn PackageLoader + Send + Sync>
A package loader.
sourcefn module_cache(&self) -> Arc<dyn ModuleCache + Send + Sync>
fn module_cache(&self) -> Arc<dyn ModuleCache + Send + Sync>
A cache for compiled modules.
sourcefn new_store(&self) -> Store
fn new_store(&self) -> Store
Create a new wasmer::Store
.
sourcefn http_client(&self) -> Option<&DynHttpClient>
fn http_client(&self) -> Option<&DynHttpClient>
Get a custom HTTP client
sourcefn tty(&self) -> Option<&(dyn TtyBridge + Send + Sync)>
fn tty(&self) -> Option<&(dyn TtyBridge + Send + Sync)>
Get access to the TTY used by the environment.
sourcefn load_module<'a>(
&'a self,
wasm: &'a [u8],
) -> BoxFuture<'a, Result<Module, SpawnError>>
fn load_module<'a>( &'a self, wasm: &'a [u8], ) -> BoxFuture<'a, Result<Module, SpawnError>>
Load a a Webassembly module, trying to use a pre-compiled version if possible.
sourcefn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError>
fn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError>
Load a a Webassembly module, trying to use a pre-compiled version if possible.
Non-async version of Self::load_module
.
sourcefn on_taint(&self, _reason: TaintReason)
fn on_taint(&self, _reason: TaintReason)
Callback thats invokes whenever the instance is tainted, tainting can occur for multiple reasons however the most common is a panic within the process
sourcefn journals(&self) -> &Vec<Arc<DynJournal>>
fn journals(&self) -> &Vec<Arc<DynJournal>>
The list of journals which will be used to restore the state of the runtime at a particular point in time
sourcefn active_journal(&self) -> Option<&DynJournal>
fn active_journal(&self) -> Option<&DynJournal>
The snapshot capturer takes and restores snapshots of the WASM process at specific points in time by reading and writing log entries