(&self, instance: StoreInstanceId)
| 1627 | } |
| 1628 | |
| 1629 | pub fn module_for_instance(&self, instance: StoreInstanceId) -> Option<&'_ Module> { |
| 1630 | instance.store_id().assert_belongs_to(self.id()); |
| 1631 | match self.instances[instance.instance()].kind { |
| 1632 | StoreInstanceKind::Dummy => None, |
| 1633 | StoreInstanceKind::Real { module_id } => { |
| 1634 | let module = self |
| 1635 | .modules() |
| 1636 | .module_by_id(module_id) |
| 1637 | .expect("should always have a registered module for real instances"); |
| 1638 | Some(module) |
| 1639 | } |
| 1640 | } |
| 1641 | } |
| 1642 | |
| 1643 | /// Accessor from `InstanceId` to `&vm::Instance`. |
| 1644 | /// |
no test coverage detected