MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / global

Method global

crates/tinywasm/src/instance.rs:572–577  ·  view source on GitHub ↗

Get a global export by name.

(&self, name: &str)

Source from the content-addressed store, hash-verified

570
571 /// Get a global export by name.
572 pub fn global(&self, name: &str) -> Result<Global> {
573 match self.require_export(name)? {
574 ExternVal::Global(global_addr) => Ok(Global::from_store_addr(self.0.store_id, global_addr)),
575 _ => Err(Error::Other(format!("Export is not a global: {name}"))),
576 }
577 }
578
579 /// Set the value of a mutable global export by name.
580 pub fn global_set(&self, store: &mut Store, name: &str, value: WasmValue) -> Result<()> {

Callers 2

global_getMethod · 0.45
global_setMethod · 0.45

Calls 1

require_exportMethod · 0.80

Tested by

no test coverage detected