Get a global export by name.
(&self, name: &str)
| 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<()> { |
no test coverage detected