Looks up an exported [`Extern`] value by name. This method will search the module for an export named `name` and return the value, if found. Returns `None` if there was no export named `name`. # Panics Panics if `store` does not own this instance. # Why does `get_export` take a mutable context? This method requires a mutable context because an instance's exports are lazily populated, and we
(&self, mut store: impl AsContextMut, name: &str)
| 436 | /// instantiating a module faster, but also means this method requires a |
| 437 | /// mutable context. |
| 438 | pub fn get_export(&self, mut store: impl AsContextMut, name: &str) -> Option<Extern> { |
| 439 | let store = store.as_context_mut().0; |
| 440 | let module = store[self.id].env_module(); |
| 441 | let name = module.strings.get_atom(name)?; |
| 442 | let entity = *module.exports.get(&name)?; |
| 443 | Some(self._get_export(store, entity)) |
| 444 | } |
| 445 | |
| 446 | /// Looks up an exported [`Extern`] value by a [`ModuleExport`] value. |
| 447 | /// |
no test coverage detected