Trait sc_executor_common::runtime_blob::InstanceGlobals [−][src]
pub trait InstanceGlobals {
type Global: Clone;
fn get_global(&self, export_name: &str) -> Self::Global;
fn get_global_value(&self, global: &Self::Global) -> Value;
fn set_global_value(&self, global: &Self::Global, value: Value);
}Expand description
An adapter for a wasm module instance that is focused on getting and setting globals.
Associated Types
Required methods
fn get_global(&self, export_name: &str) -> Self::Global
fn get_global(&self, export_name: &str) -> Self::GlobalGet a handle to a global by it’s export name.
The requested export is must exist in the exported list, and it should be a mutable global.
fn get_global_value(&self, global: &Self::Global) -> Value
fn get_global_value(&self, global: &Self::Global) -> ValueGet the current value of the global.
fn set_global_value(&self, global: &Self::Global, value: Value)
fn set_global_value(&self, global: &Self::Global, value: Value)Update the current value of the global.
The global behind the handle is guaranteed to be mutable and the value to be the same type as the global.