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

Method func_by_index

crates/tinywasm/src/instance.rs:443–454  ·  view source on GitHub ↗
(&self, store: &Store, func_index: FuncAddr)

Source from the content-addressed store, hash-verified

441 #[cfg_attr(docsrs, doc(cfg(feature = "guest-debug")))]
442 #[cfg(feature = "guest-debug")]
443 pub fn func_by_index(&self, store: &Store, func_index: FuncAddr) -> Result<Function> {
444 self.validate_store(store)?;
445 let func_addr = Self::index_addr(&self.0.func_addrs, func_index, "function")?;
446
447 let ty = store.state.get_func(func_addr).ty();
448 Ok(Function {
449 item: crate::StoreItem::new(self.0.store_id, func_addr),
450 addr: func_addr,
451 module_addr: self.id(),
452 ty: ty.clone(),
453 })
454 }
455
456 /// Get a typed function export by name.
457 ///

Callers 2

func_typed_by_indexMethod · 0.80

Calls 4

get_funcMethod · 0.80
validate_storeMethod · 0.45
tyMethod · 0.45
idMethod · 0.45

Tested by 1