Invoke the start function of the module Returns `None` if the module has no start function ## Example ```rust # fn main() -> tinywasm::Result<()> { # use tinywasm::{ModuleInstance, Store}; # let wasm = wat::parse_str(r#" # (module # (global $g (mut i32) (i32.const 0)) # (func (export "_start") # i32.const 7 # global.set $g) # (export "g" (global $g))) # "#).
(&self, store: &mut Store)
| 674 | /// |
| 675 | /// See <https://webassembly.github.io/spec/core/syntax/modules.html#syntax-start> |
| 676 | pub fn start(&self, store: &mut Store) -> Result<Option<()>> { |
| 677 | match self.start_func(store)? { |
| 678 | Some(func) => func.call(store, &[]).map(|_| Some(())), |
| 679 | None => Ok(None), |
| 680 | } |
| 681 | } |
| 682 | } |