Returns a `Func` corresponding to the startup function for this instance, if generated at compile time. # Safety The `store` parameter must be the store that owns this instance and the functions that this instance can reference.
(
self: Pin<&mut Self>,
registry: &ModuleRegistry,
store: StoreId,
)
| 621 | /// The `store` parameter must be the store that owns this instance and the |
| 622 | /// functions that this instance can reference. |
| 623 | pub unsafe fn get_startup_func( |
| 624 | self: Pin<&mut Self>, |
| 625 | registry: &ModuleRegistry, |
| 626 | store: StoreId, |
| 627 | ) -> Option<crate::Func> { |
| 628 | let func_ref = self.get_start_func_ref(registry)?; |
| 629 | |
| 630 | // SAFETY: the validity of `func_ref` is guaranteed by the validity of |
| 631 | // `self`, and the contract that `store` must own `func_ref` is a |
| 632 | // contract of this function itself. |
| 633 | Some(unsafe { crate::Func::from_vm_func_ref(store, func_ref) }) |
| 634 | } |
| 635 | |
| 636 | /// Lookup a table by index. |
| 637 | /// |
no test coverage detected