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

A handle to a global which can be used to get or set a global variable. This is supposed to be a lightweight handle, like an index or an Rc-like smart-pointer, which is cheap to clone.

Required methods

Get 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.

Get the current value of the global.

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.

Implementors