pub trait Runtimewhere
Self: Debug,{
Show 22 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 engine_with_suggested_opts(
&self,
suggested_opts: &SuggestedCompilerOptimizations,
) -> Result<Engine, CompileError> { ... }
fn new_store(&self) -> Store { ... }
fn http_client(&self) -> Option<&DynHttpClient> { ... }
fn tty(&self) -> Option<&(dyn TtyBridge + Send + Sync)> { ... }
fn resolve_module<'a>(
&'a self,
input: ModuleInput<'a>,
engine: Option<&Engine>,
on_progress: Option<ModuleLoadProgressReporter>,
) -> BoxFuture<'a, Result<Module, SpawnError>> { ... }
fn resolve_module_sync(
&self,
input: ModuleInput<'_>,
engine: Option<&Engine>,
on_progress: Option<ModuleLoadProgressReporter>,
) -> Result<Module, SpawnError> { ... }
fn load_command_module(
&self,
cmd: &BinaryPackageCommand,
) -> BoxFuture<'_, Result<Module, SpawnError>> { ... }
fn load_command_module_sync(
&self,
cmd: &BinaryPackageCommand,
) -> Result<Module, SpawnError> { ... }
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 load_hashed_module(
&self,
module: HashedModuleData,
engine: Option<&Engine>,
) -> BoxFuture<'_, Result<Module, SpawnError>> { ... }
fn load_hashed_module_sync(
&self,
wasm: HashedModuleData,
engine: Option<&Engine>,
) -> Result<Module, SpawnError> { ... }
fn on_taint(&self, _reason: TaintReason) { ... }
fn read_only_journals<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Arc<DynReadableJournal>> + 'a> { ... }
fn writable_journals<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Arc<DynJournal>> + 'a> { ... }
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.
fn engine_with_suggested_opts( &self, suggested_opts: &SuggestedCompilerOptimizations, ) -> Result<Engine, CompileError>
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 resolve_module<'a>(
&'a self,
input: ModuleInput<'a>,
engine: Option<&Engine>,
on_progress: Option<ModuleLoadProgressReporter>,
) -> BoxFuture<'a, Result<Module, SpawnError>>
fn resolve_module<'a>( &'a self, input: ModuleInput<'a>, engine: Option<&Engine>, on_progress: Option<ModuleLoadProgressReporter>, ) -> BoxFuture<'a, Result<Module, SpawnError>>
The primary way to load a module given a module input.
The engine to use can be optionally provided, otherwise the most appropriate engine should be selected.
An optional progress reporter callback can be provided to report progress during module loading.
Sourcefn resolve_module_sync(
&self,
input: ModuleInput<'_>,
engine: Option<&Engine>,
on_progress: Option<ModuleLoadProgressReporter>,
) -> Result<Module, SpawnError>
fn resolve_module_sync( &self, input: ModuleInput<'_>, engine: Option<&Engine>, on_progress: Option<ModuleLoadProgressReporter>, ) -> Result<Module, SpawnError>
Sync variant of Self::resolve_module.
Sourcefn load_command_module(
&self,
cmd: &BinaryPackageCommand,
) -> BoxFuture<'_, Result<Module, SpawnError>>
👎Deprecated since 0.601.0: Use resolve_module instead
fn load_command_module( &self, cmd: &BinaryPackageCommand, ) -> BoxFuture<'_, Result<Module, SpawnError>>
resolve_module insteadLoad the module for a command.
Will load the module from the cache if possible, otherwise will compile.
NOTE: This always be preferred over Self::load_module to avoid
re-hashing the module!
Sourcefn load_command_module_sync(
&self,
cmd: &BinaryPackageCommand,
) -> Result<Module, SpawnError>
👎Deprecated since 0.601.0: Use resolve_module_sync instead
fn load_command_module_sync( &self, cmd: &BinaryPackageCommand, ) -> Result<Module, SpawnError>
resolve_module_sync insteadSync version of Self::load_command_module.
Sourcefn load_module<'a>(
&'a self,
wasm: &'a [u8],
) -> BoxFuture<'a, Result<Module, SpawnError>>
👎Deprecated since 0.601.0: Use resolve_module instead
fn load_module<'a>( &'a self, wasm: &'a [u8], ) -> BoxFuture<'a, Result<Module, SpawnError>>
resolve_module insteadLoad a WebAssembly module from raw bytes.
Will load the module from the cache if possible, otherwise will compile.
Sourcefn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError>
👎Deprecated since 0.601.0: Use load_command_module or load_hashed_module instead - this method can have high overhead
fn load_module_sync(&self, wasm: &[u8]) -> Result<Module, SpawnError>
load_command_module or load_hashed_module instead - this method can have high overheadSynchronous version of Self::load_module.
Sourcefn load_hashed_module(
&self,
module: HashedModuleData,
engine: Option<&Engine>,
) -> BoxFuture<'_, Result<Module, SpawnError>>
fn load_hashed_module( &self, module: HashedModuleData, engine: Option<&Engine>, ) -> BoxFuture<'_, Result<Module, SpawnError>>
Load a WebAssembly module from pre-hashed data.
Will load the module from the cache if possible, otherwise will compile.
Sourcefn load_hashed_module_sync(
&self,
wasm: HashedModuleData,
engine: Option<&Engine>,
) -> Result<Module, SpawnError>
fn load_hashed_module_sync( &self, wasm: HashedModuleData, engine: Option<&Engine>, ) -> Result<Module, SpawnError>
Synchronous version of Self::load_hashed_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 read_only_journals<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Arc<DynReadableJournal>> + 'a>
fn read_only_journals<'a>( &'a self, ) -> Box<dyn Iterator<Item = Arc<DynReadableJournal>> + 'a>
The list of all read-only journals which will be used to restore the state of the runtime at a particular point in time
Sourcefn writable_journals<'a>(
&'a self,
) -> Box<dyn Iterator<Item = Arc<DynJournal>> + 'a>
fn writable_journals<'a>( &'a self, ) -> Box<dyn Iterator<Item = Arc<DynJournal>> + 'a>
The list of writable journals which will be appended to
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