| 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 | /// |