Looks up an exported [`Extern`] value by a [`ModuleExport`] value. This is similar to [`Instance::get_export`] but uses a [`ModuleExport`] value to avoid string lookups where possible. [`ModuleExport`]s can be obtained by calling [`Module::get_export_index`] on the [`Module`] that this instance was instantiated with. This method will search the module for an export with a matching entity index a
(
&self,
mut store: impl AsContextMut,
export: &ModuleExport,
)
| 458 | /// |
| 459 | /// Panics if `store` does not own this instance. |
| 460 | pub fn get_module_export( |
| 461 | &self, |
| 462 | mut store: impl AsContextMut, |
| 463 | export: &ModuleExport, |
| 464 | ) -> Option<Extern> { |
| 465 | let store = store.as_context_mut().0; |
| 466 | |
| 467 | // Verify the `ModuleExport` matches the module used in this instance. |
| 468 | if self._module(store).id() != export.module { |
| 469 | return None; |
| 470 | } |
| 471 | |
| 472 | Some(self._get_export(store, export.entity)) |
| 473 | } |
| 474 | |
| 475 | fn _get_export(&self, store: &mut StoreOpaque, entity: EntityIndex) -> Extern { |
| 476 | let id = store.id(); |
nothing calls this directly
no test coverage detected